Question: Write a Java program class named 'Member' having the following members: Data members 1 - Name 2 - Age 3 - Phone number 4 -
Write a Java program
class named 'Member' having the following members:
Data members
1 - Name
2 - Age
3 - Phone number
4 - Address
5 - Salary
It also has a method named 'printSalary' which prints the salary of the members.
Two classes 'Employee' and 'Manager' inherits the 'Member' class. The 'Employee' and 'Manager' classes have data members 'specialization' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a manager by making an object of both of these classes and print the same.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
