package packed;
public class pack
{
static public int x1 = 7;
static protected int x2 = 8;
static int x3=9;
static private int x4 =10;
}
________________________________________________
import packed.pack;
class
test extends pack
{
public static void main(
String args[] )
{
pack p = new pack();
System.out.println( pack.x2 );
}
}
this is giving output "8". But if i removes static modifier from x2, there is an error. Please explain