Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student extends Person {
- //data fields or properties
- private String studentID;
- //No-arg constructor
- Student(){
- setFirstName("NA");
- setLastName("NA");
- studentID = "NA";
- }
- //Constructor
- Student(String fName, String lName, String sID){
- setFirstName(fName);
- setLastName(lName);
- studentID = sID;
- }
- //Setters
- public void setStudentID (String sID){
- studentID = sID;
- }
- //Getters
- public String getStudentID(){
- return studentID;
- }
- //This method overrides the same method in Person.java
- public String getFullNamePlusID(){
- return (super.getFullName() + ": " + studentID);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement