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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started