Hi All,
I compiled the below code and didnt get any compile error.It runs fine.
But as per K&B, it should produce a compile error.
Code
------
package A;
public class Father{
static public int x1 = 7;
static protected int x2 = 8;
static int x3=9;
static private int x4 =10;
}
package B;
import A.Father;
public class Son extends Father{
public static void main(
String [] arg){
Father f = new Father();
System.out.println( f.x2 );
}
}
May I know why this compiles fine?
Thanks
Sumi