Superclass with no constructors
857249Apr 22 2011 — edited Apr 23 2011I am using third party libraries to do my development. The base class I am extending my class from does not have any constructors (with or without arguments). So, during compilation I get the following error message
"Implicit super constructor Foo() is undefined. Must explicitly invoke another constructor."
So, I declared a new constructor with argument in my class but still got the same error message. So, I added the the statement super(); to it. I got the error message
"Constructor Foo() is undefined"
Code Snippet:
public class ChildFoo extends Foo {
String name;
public ChildFoo(String name){
super();
this.name = name;
}
}
Since class Foo() extends from java.lang.Object my assumption was it will invoke the java.lang.Object default constructor since it is chained.
I am at a loss. It has been some years I have coded in java. Any help is appreciated,