Can a class with a private no argument constructor can be extended.
I run this code:
class base{
private base(){}
public base(int i){
System.out.println("i am in base args");
}
}
public class Foo extends base{
public static void main(
String args[]){
Foo o = new Foo();
}
}
I get an error: cannot find symbol
symbol : constructor base()
location: class javaapplication1.base
I understand that since the consructor is private and can only be called from same class, does it also means that any class with a private no-args constructor cannot be extended.