-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeeMain.java
More file actions
30 lines (25 loc) · 1.17 KB
/
Copy pathEmployeeMain.java
File metadata and controls
30 lines (25 loc) · 1.17 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 EmployeeMain {
//Inheritance
public static void main(String[] args) {
Person person=new Person();
Employee employee1=new Employee();
Employee employee2=new Employee();
person.setAge(20);
person.setName("Hari");
person.setAddress("Kerala");
employee1.setAge(32);
employee1.setName("Vasu");
employee1.setAddress("India");
employee1.setEmpID(452);
employee1.setDesignation("QA");
employee2.setAge(45);
employee2.setName("Helen");
employee2.setAddress("UK");
employee2.setEmpID(786);
employee2.setDesignation("FSD");
System.out.println("Printing Person's details::\n******************\nage,name and Address are::"+person.getAge()+" "+person.getName()+" "+person.getAddress());
System.out.println("\nPrinting Employee Details\n*********************");
System.out.println("Name,address,age,EmpId,Designation::"+employee1.getName()+""+employee1.getAddress()+" "+employee1.getAge()+" "+employee1.getEmpID()+ " "+ employee1.getDesignation());
System.out.println("Name,address,age,EmpId,Designation::"+employee2.getName()+""+employee2.getAddress()+" "+employee2.getAge()+" "+employee2.getEmpID()+ " "+ employee2.getDesignation());
}
}