-1

I am just wondering what is super() and how it works. I have (general) idea, but I'm not quite sure about it. I'm wondering if this is right:

class ExampleClass extends File{
 public ExampleClass(String str){
    super(str);
 }
}

I am also wondering if super(); is actually helpful / efficient its use.

OddDev
  • 3,644
  • 5
  • 30
  • 53
  • `super(...)` has nothing to do with _helpful/efficient_, it's a Java language feature needed to initialise an object hierarchy. – T.Gounelle Apr 21 '15 at 13:42

1 Answers1

3

super() calls the constructor of the the super class (the class extended by the class in which the call is made).

EvenLisle
  • 4,672
  • 3
  • 24
  • 47