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.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
35 views
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.