Why is it that when I invoke the Derived constructor from the main method, I get a compilation error pointing to the Derived constructor of the Derived class. I never called the Base constructor of the Base class. Therefore why is the error happening?.
class Base
{
private Base()
{
System.out.print("Base");
}
}
public class Derived extends Base
{
public Derived()
{
System.out.print("Derived");
}
public static void main(String[] args)
{
new Derived();
}
}