-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestEmployee.java
More file actions
51 lines (42 loc) · 1.03 KB
/
TestEmployee.java
File metadata and controls
51 lines (42 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class Employee{
String name,dob;
int id;
Employee(String n,String d,int i){
name = n;
dob = d;
id = i;
}
void display(){
System.out.println("Employeee Name :" + name);
System.out.println("Date of birth :" + dob);
System.out.println("Employeee ID :" + id);
}
}
class Manager extends Employee{
double salary ;
Manager(String n,String d,int i,double s){
super(n,d,i);
salary = s;
}
void display(){
super.display();
System.out.println("Employeee salary :" + salary);
}
}
class SalseManager extends Manager{
double commission;
SalseManager(String n, String d,int i,double s,double c){
super(n,d,i,s);
commission = c;
}
void display(){
super.display();
System.out.println("Employeee commission :" + commission);
}
}
class TestEmployee{
public static void main(String args[]){
SalseManager s1 = new SalseManager("Kunal","06-07-2004",212,80000,10000);
s1.display();
}
}