How to extend a class in learn java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to extend a class in learn java?

27th Sep 2016, 12:41 PM
sajin
sajin - avatar
1 Answer
+ 1
class A{ int a; String b; void get(){ //your logic } } Class B extends A{ int c; String Address; void Show(){ //your logic } } here the class B is child class which extends its super class which is class A. it means class B have all the variable and method of class A and its method and variable also.
27th Sep 2016, 2:48 PM
Meher jeet
Meher jeet - avatar