I have a question regarding the proctected modifier..
public class pack
static public int x1 = 7;
protected int x2 = 8;
static int x3=9;
static private int x4 =10;
class test3 extends pack
public static void main( String args )
pack p = new pack();
I got an error saying that x2 is not visible on line "System.out.println(p.x2);" of test3 class.
I thought the protected modifier on variables would mean that subclasses and classes in the same package would have access to the protected variable of the parent class?