0

What is the word (super) in java

What is the word (super) in java

29th Oct 2016, 2:13 PM
Abdullah Al Mohammad
Abdullah Al Mohammad - avatar
1 Odpowiedź
+ 1
Super refers to the superclass of a extended class which means anytime you extend a class and then use the super keyword with a specific method you are using the method from that super class for example lets say : Father extends Grandfather and then Son extends Father. Grandfather and Father has a method called foo() in order to call that foo() method from the Grandfather class in the Son class you would need to write super.foo() which will call the method from the super class which would be calling the foo() method from the Grandfather class.
29th Oct 2016, 3:57 PM
Tech Go
Tech Go - avatar