Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1.  
  2. public class Student extends Person{
  3.  
  4. private String studentId;
  5.  
  6. public Student() {
  7. //this("", "", "");
  8. }
  9. // constructor
  10. public Student(String name, String phoneNumber, String studentId){
  11. super(name,phoneNumber); // call parent's cons
  12. this.studentId = studentId;
  13. }
  14.  
  15.  
  16. public String toString() {
  17. return super.toString() + " has student ID" + studentId;
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement