-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQB 794.java
More file actions
61 lines (50 loc) · 1.55 KB
/
QB 794.java
File metadata and controls
61 lines (50 loc) · 1.55 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
55
56
57
58
59
60
61
//QB 794
class member {
String name;
int age;
long ph;
String add;
int salary;
void printsalary() {
System.out.println("Salary is " + salary);
}
}
class employee extends member {
String specialization;
}
class manager extends member {
String department;
public static void main(String[] args) {
// making object for employee
employee e = new employee();
e.name = ("Ishan");
e.age = 18;
e.ph = 9106550238l;
e.add = "LJIET";
e.salary = 153000;
e.specialization = "CST";
// making object for manager
manager m = new manager();
m.name = ("Raj");
m.age = 33;
m.ph = 7878468648l;
m.add = "SG.HIGHWAY";
m.salary = 2500000;
m.department = "FY3";
System.out.println("Employee details");
System.out.println("Name is " + e.name);
System.out.println("Age is " + e.age);
System.out.println("Phone is " + e.ph);
System.out.println("Address is " + e.add);
System.out.println("Salary is " + e.salary);
System.out.println("Specialization is " + e.specialization);
System.out.println();
System.out.println("Manager details");
System.out.println("Name is " + m.name);
System.out.println("Age is " + m.age);
System.out.println("Phone is " + m.ph);
System.out.println("Address is " + m.add);
System.out.println("Salary is " + m.salary);
System.out.println("Department is " + m.department);
}
}