The program demonstrates inheritance by defining a Father class with an integer field a, then defining a Child class that extends Father and is able to access the inherited field a to print its value of 10 in the main method.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
40 views1 page
Program To Show Inheritance
The program demonstrates inheritance by defining a Father class with an integer field a, then defining a Child class that extends Father and is able to access the inherited field a to print its value of 10 in the main method.