I have a quick question regarding how super() is used in a constructor. I know the basics about how it will call a superclass but I recently looked at some code and don't understand how it is being used in this example. Here's the gist of the part that confuses me:
public class MyClass implements MyInterface {
String myString = null;
public MyClass() {
super();
}
public MyClass(String A) {
super();
myString = A;
}
public interfaceMethod {
// this is the method from MyInterface
}
}
I understand how the constructors are being used and all but I just don't see the point to the super() methods in them. Does it have to do with the interface that it's implementing? I thought super() was used if a class extends something? Am I missing some basic knowledge about java here? Any help for a noob would be much appreciated. Thanks!