Hi venkatesh,
The problem with your prgm., is
protected members of a class are visible to its sub class in different package only through inheritence(and not with object reference) In your program,
'protected x2' of 'pack' is visible into 'test' only through inheritence. So System.out.println(x2); is valid. but x2 is not a static member. so you may need a non-static method for class test to display x2 as the following
x4 is visible only in class 'pack' as it is private and x3 is not visible into 'test' as it is neither public nor protected.
jagan.k
[ August 15, 2008: Message edited by: jagan kay ]