In 2 files I have this code:
File1: -----
import MyPackA.AA;
public class BB extends AA
{
public static void main(
String... args)
{
BB b = new BB();
AA a = new AA();
System.out.print(b.getI() + " " + a.getI());
}
int geti() { return super.getI() ; }
}
File2: -----
package MyPackA;
public class AA
{
protected int i = 11;
protected int getI () { return i; }
}
Class BB does not compile because a.getI() is not visible at line 1.
However the super.getI() (line 2) compiles.
It seems to me that both are in a sense the same.
Yet the compiler treats them different ??