forked from maheshashokit/27_Java_Full_Stack_Repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiLevelInheritanceClient.java
More file actions
32 lines (22 loc) · 959 Bytes
/
MultiLevelInheritanceClient.java
File metadata and controls
32 lines (22 loc) · 959 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
25
26
27
28
29
30
31
32
public class MultiLevelInheritanceClient {
public static void main(String[] args) {
//creating the object for SmartWatch class
SmartWatch sw = new SmartWatch();
//calling time functionality from grand Parent class
sw.setTimeForWatch(8, 53, 39);
//calling date functionality from parent class
sw.setDateForWatch(04, "MAY", 2023);
//calling Temperature functionality from SmartWatch class only
sw.setTemperatureForSmartWatch(42.52d);
//calling time display method from grand parent class
sw.displayTimeForWatch();
//calling date display method from parent class
sw.displayDateForWatch();
//calling temperature display method from SmartWatch class
sw.displayTemperatureInfo();
//calling additional business method from SmartWatch Class
sw.displayHealthInfo();
//Accessing super grand parent properties(java.lang.Object)
System.out.println("Super Grand Parent Methods :::::" + sw.hashCode());
}
}