-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprog2.java
35 lines (33 loc) · 966 Bytes
/
prog2.java
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
package OOPlab;
class Staff {
private String StaffId;
private String Name;
private String Phone;
private String Salary;
public Staff(String StaffId,String Name,String Phone,String Salary) {
this.StaffId=StaffId;
this.Name=Name;
this.Phone=Phone;
this.Salary=Salary;
}
public void display(){
System.out.println("Staff ID"+ StaffId);
System.out.println("Name"+ Name);
System.out.println("Phone"+ Phone);
System.out.println("Salary"+ Salary);
}
}
class Teaching extends Staff {
private String Domain;
private String publications;
Teaching(String Domain,String publications,String Name,String StaffId,String Phone,String Salary){
super( StaffId,Phone,Name,Salary);
this.Domain=Domain;
this.publications=publications;
}
public void display(){
super.display();
System.out.println("Domain"+ Domain);
System.out.println("Publictions"+ publications);
}
}