-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMember.java
More file actions
55 lines (47 loc) · 1.61 KB
/
Member.java
File metadata and controls
55 lines (47 loc) · 1.61 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
52
53
54
import java.lang.String;
class DataOut{
public static void main(String[] args){
Employee emp = new Employee();
emp.name="KakaShi";
emp.age=21;
emp.number=9563808;
emp.address="Dishergarh";
emp.salary=56000;
emp.specialization="Web Developer";
System.out.println("Name of the Employee: " + emp.name);
System.out.println("Age of the Employee: " + emp.age);
System.out.println("Number of the Employee: " + emp.number);
System.out.println("Address of the Employee: " + emp.address);
System.out.println("Salary of the Employee: " + emp.salary);
System.out.println("Specialization of the Employee: " + emp.specialization);
Manager mng = new Manager();
mng.name="Hatake";
mng.age=24;
mng.number=95638;
mng.address="Asansol";
mng.salary=78000;
mng.Department="Quality Control";
System.out.println("Name of the Manager: " + mng.name);
System.out.println("Age of the Manager: " + mng.age);
System.out.println("Number of the Manager: " + mng.number);
System.out.println("Address of the Manager: " + mng.address);
System.out.println("Salary of the Manager: " + mng.salary);
System.out.println("Specialization of the Manager: " + mng.Department);
}
}
class Member {
String name;
int age;
long number;
String address;
int salary;
public void printSalary(){
System.out.println(salary);
}
}
class Employee extends Member {
String specialization;
}
class Manager extends Member {
String Department;
}