Question: Write in java language the declaration for the following. In a Company there are three departments HR,Finance,Sales. Each department has employees, the employees can be

Write in java language the declaration for the following.

In a Company there are three departments HR,Finance,Sales. Each department has employees, the employees can be full-time or part-time.

Class company, Fields : Nameof the comapny , Location.

Class HR, Fields : any 2 Fields.

Class Finance, Fields : any 3 fields

Class Sales, Fields : any 2 fields

Class employee, Fields : tName,Id,Age.

Class Full-time_Employee , Fields : any fields of your choice

Class Part-time _Employee, Fields: any fields of your choice

Class StaffMembers , Fields: staffID.

a. Define all the given classes and Draw an inheritance relationship between the classes.

b. The Company class should have a list of staff members, use ArrayList. All the Methods in the comapny class should be declared as protected.

c. Declare a method display() in the company class and override the display() method in all subclasses.

d. In class Finance, show how the call to a base class contrcutor is made.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!