Question: Write a program implementing Simple Inheritance for the given problem: Create a parent class that includes the following: 1) Parameterized constructor 2) Write a
Write a program implementing Simple Inheritance for the given problem: Create a parent class that includes the following: 1) Parameterized constructor 2) Write a method to display the output Create a child class that includes the following: 1) Parameterized constructor by invoking the super class constructor and then initialize the member variables of the child class. 2) Write an overriding method to display the output Create a controlling class that includes the following: 1) Input the necessary details as required by referring to the sample inputs. 2) Create the doctor object 3) Call the necessary method to display the output as required. Add the following to the activity: Add one more child (Engineer) that have the following: Employee Employee id Employee name Employee city From the controlling class input the values, create object and display the output. Doctor Hospital name Clinic name Salary 1) Member variables: Company, department and salary. 2) Parameterized constructor by invoking the super class constructor and then initialize the member variables of the child class. 3) Write an overriding method to display the output
Step by Step Solution
3.23 Rating (158 Votes )
There are 3 Steps involved in it
import javautilScanner Controller class public class Main public static void mainString args Scanner sc new ScannerSystemin declare variables String id name city hospitalName clinicName company depart... View full answer
Get step-by-step solutions from verified subject matter experts
