how we use a inheritance in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how we use a inheritance in java

27th Aug 2016, 6:18 AM
Pradeep Saini
Pradeep Saini - avatar
4 Answers
+ 2
use the extends key word eg: public class ant extends insect{ } // then you will be able to make use of of the method in the supper class which is the insect
27th Aug 2016, 11:14 AM
Paul Bereobong Clement
Paul Bereobong Clement - avatar
+ 1
use extends keyword ex: class Father{} class Son extends Father{}
27th Aug 2016, 7:47 AM
Tiger
Tiger - avatar
+ 1
throw extends key word
27th Aug 2016, 6:30 PM
Mahender
Mahender - avatar
0
thanks friends
29th Aug 2016, 4:53 AM
Pradeep Saini
Pradeep Saini - avatar