package package1;
public class Protection
{
private int pri=1;
protected int pro=2;
public int pub=3;
public void show()
{
System.out.println("Value of private variable is :"+pri);
System.out.println("Value of protected variable is :"+pro);
System.out.println("Value of public variable is :"+pub);
}
public static void main(String s[])
{
Protection p=new Protection();
p.show();
//p.pro=0;
}
}
The above code shows a runtime error indicating :
Could not find or load class Protection
I have tried and created a package1 folder, but it still does not work at all.