Well,
If you have Protected variables/Method in class pack1class.
and you are accessing it in subclass of pack1subclass (Please use Extends pack1class against it).
Then,
You can not access a Protected variable on Reference of the Super Class.
So,
pack1class pc=new pack1class();
System.out.println("protected method"+pc.prot); is Wrong!!
You should do it only through Inheritance.
like,replacing above code piece with this
System.out.println("protected method"+prot);
For More CClarifaication Refer to K& B Page no 35