- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson2.java
More file actions
Latest commit
23 lines (22 loc) · 522 Bytes
/
Copy pathPerson2.java
File metadata and controls
23 lines (22 loc) · 522 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
classTestCase{
publicstaticvoidmain(String[] args) {
Student2s = newStudent2();
s.display();
}
}
classPerson2 {
voidmessage() {
System.out.println("This is person class");
}
}
classStudent2extendsPerson2{
voidmessage() {
System.out.print("This is student class");
}
voiddisplay(){
System.out.print("\nMy Parent's Message was\t: ");
super.message();
System.out.print("My Child's Message was\t: ");
message();
}
}