Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student extends Person{
- private String studentId;
- public Student() {
- //this("", "", "");
- }
- // constructor
- public Student(String name, String phoneNumber, String studentId){
- super(name,phoneNumber); // call parent's cons
- this.studentId = studentId;
- }
- public String toString() {
- return super.toString() + " has student ID" + studentId;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement