hi all
i have two classes:
package base;
public class Super
{
protected Super()
{
}
}
and
package base.inner;
import base.Super;
public class Sub extends Super
{
public Sub()
{
super();
}
public void func()
{
new Super();
}
}
Eclipse says that i can call "new Super()" because it is not visible. It suggests to change the Super constructor to be protected (which is already!). Note that the two classes are in different packages. If they are in the same one, it compiles ok.
anyone know y? can protected constructors only be called as "super()" in the sub classes and not to create real super objects in the sub classes?