A parent class named A has an integer data member 'm' and a method named 'printNum' to print the value of 'm'. Its child class named B also has an integer data member 'n' and a method named 'printNum' to print the value of 'n'. Make an object of the child class B and use it to assign a value of 'n' to 'm'. Now call the method 'printNum' by this object.
Answers
Answered by
0
Explanation:
wbx ucqlt yoe eshzg ozbfys fozfr
Answered by
2
Answer:
A parent class named A has an integer data member 'm' and a method named 'printNum' to print the value of 'm'. Its child class named B also has an integer data member 'n' and a method named 'printNum' to print the value of 'n'. Make an object of the child class B and use it to assign a value of 'n' to 'm'. Now call the method 'printNum' by this object.
Similar questions