forked from maheshashokit/27_Java_Full_Stack_Repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHierarchicalInheritanceClient.java
More file actions
30 lines (24 loc) · 1.03 KB
/
HierarchicalInheritanceClient.java
File metadata and controls
30 lines (24 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public class HierarchicalInheritanceClient {
public static void main(String[] args) {
//Creating Object for Trainer class
Trainer t = new Trainer(122,"Java",6.5f);
//Calling super class method using trainer object
t.setPersonDetails("Mahesh", "Mahesh.ashokit@gmail.com", "1234567890");
//calling the display method for values
t.displayPersonalDetailsInfo();
t.displayTrainerDetails();
System.out.println("========================================================");
//Creating Object for Developer Class
Developer dev = new Developer("Java",5.3f,25000.00d);
//Using dev class object accessing parent class methods
dev.setPersonDetails("Ashok", "ashokitschools@gmail.com", "1111111");
//calling the display method for values
dev.displayPersonalDetailsInfo();
dev.displayDeveloperInformation();
//printing the Trainer Object
System.out.println(t.toString());
//printing the Developer Object
System.out.println(dev.toString());
System.out.println("Company Name::::" + Employee.companyName);
}
}