-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
34 lines (26 loc) · 730 Bytes
/
Copy pathEmployee.java
File metadata and controls
34 lines (26 loc) · 730 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
33
34
package inheritanceExample;
public class Employee extends Worker {
String workSpelization = "Developer";
String deparement = "Cyber Security";
void assign() {
sName = "Gajendra";
age = 22;
phoneNo = 86009740;
address = "At Post Makodi";
salary = 78000;
}
void displayData() {
System.out.println("Name : "+sName);
System.out.println("Age : "+age);
System.out.println("Phone Number : "+phoneNo);
System.out.println("Address : "+address);
System.out.println("Work Spelization : "+workSpelization);
System.out.println("Deparement : "+deparement);
}
public static void main(String[] args) {
Employee obj =new Employee();
obj.assign();
obj.displayData();
obj.displaySalary();
}
}