0
What's the difference between system.out.println("Name: " +getname()); and system.out.println("Name: " +super.getname()); ?
in the coded class, there is a super code. super(name, number, etc.)
1 Answer
+ 2
The keyword super means the super class.
Class Mother{
}
Class Child extends class Mother{
}
Mother is the super class. Child is the subclass.
Imagine both classes have a getName() method.
Inside class Child:
printing getName() would print the String from the method in this class.
printing super.getName() would print the String from the method of class Mother.