Question: java prpgraming : b. The purpose of this lab is to study about the OOPs concept Inheritance 1. Start the program. 2. Declare a class

java prpgraming :

b. The purpose of this lab is to study about the OOPs concept Inheritance

1. Start the program.

2. Declare a class Parent with name, salary and address , assign the values for all the variables using methods

3. Declare another class child extending parent with ch_name, ch_salary and ch_address , assign the values for all the variables using methods also invoke the parent method from this class

4. Define the object of child class in main()

5. Call the method where the values are assigned and Print the values of both parent and child class

6. Stop the program.

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!