I have these classes:
package com.a;
public class A {
protected String v="A";
}
-----------------------------------------------------------------------------
package com.b;
import com.a.A;
public class B extends A {
public static void main(String[] args) {
System.out.println(new A().v);
}
}
But new A().v
doesn't compile.Why? I thought subclass has access to parent's variables even though it's in separate package.