Created
January 19, 2017 17:17
-
-
Save dhust/122ac00e9d6ea3786655ce02d0c0f5a0 to your computer and use it in GitHub Desktop.
This is a Parent super class.
It will be extended by an Employee class.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person { | |
// Fields or Instance variables | |
private String name; | |
private int age; | |
private boolean isFemale; | |
// Default contructor | |
public Person () { | |
name = "Steve"; | |
age = 20; | |
isFemale = false; | |
} | |
// Constructor with arguments | |
public Person (String theName, int theAge, boolean isFemale) { | |
name = theName; | |
age = theAge; | |
this.isFemale = isFemale; | |
} | |
/** | |
* @return the person's name | |
*/ | |
public String getName() { | |
return name; | |
} | |
/** | |
* @param name sets the person's name | |
*/ | |
public void setName(String name) { | |
this.name = name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment