forked from maheshashokit/27_Java_Full_Stack_Repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
24 lines (19 loc) · 636 Bytes
/
Test.java
File metadata and controls
24 lines (19 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class Test extends Demo {
//same Field also availabile in Parent Class
public String message="Mahesh IT";
public Test() {
//Giving call to Parent class public Constructor
//super(); //Here Parent class Non-Param Constructor gets executed
//super("Welcome To Ashok IT");
System.out.println("Test");
}
public Test(String message) {
super(message); //Giving call to Parent class Param Constructor....
}
//We have same method similar to Parent class
public void display() {
System.out.println("Message :::" + message);
//System.out.println("Super Message :::" + super.message);
super.display();
}
}