forked from maheshashokit/27_Java_Full_Stack_Repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodOverridingClient.java
More file actions
43 lines (31 loc) · 1.3 KB
/
MethodOverridingClient.java
File metadata and controls
43 lines (31 loc) · 1.3 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
31
32
33
34
35
36
37
38
39
40
41
42
43
public class MethodOverridingClient {
public static void main(String[] args) {
//Creating the object for Super class
EmployeeApprasialForm epf = new EmployeeApprasialForm();
System.out.println(epf.getEmployeeForm());
System.out.println(epf.getTypeOfForm());
System.out.println();
//creating the object for sub class
EmployeeApprasialPDFForm eapf = new EmployeeApprasialPDFForm();
System.out.println(eapf.getEmployeeForm());
System.out.println(eapf.getTypeOfForm());
System.out.println();
EmployeeApprasialFillablePdfForm eafp = new EmployeeApprasialFillablePdfForm();
System.out.println(eafp.getEmployeeForm());
System.out.println(eafp.getTypeOfForm());
System.out.println();
//creating Parent class reference variable
EmployeeApprasialForm eapf1 = new EmployeeApprasialPDFForm();//upcasting
//calling getEmployeeForm method
System.out.println(eapf1.getEmployeeForm());
System.out.println(eapf1.getTypeOfForm());
System.out.println();
//overriding the object of eapf1
eapf1 = new EmployeeApprasialFillablePdfForm();
System.out.println(eapf1.getEmployeeForm());
System.out.println(eapf1.getTypeOfForm());
final float INTEREST_RATE = 5.6f;
//INTEREST_RATE = INTEREST_RATE + 0.7f;
System.out.println("Interest Rate Value:::::" + INTEREST_RATE);
}
}