hi all,
Can anyone tell me why this class throws the following compilation error?
protected class Super
{
private int i=1;
public void show(int i)
{
System.out.println("i is " + i);
}
}
public class Sub extends Super
{
public static void main(
String[] args)
{
Super s = new Super();
System.out.println("Hello World!");
s.show(2);
}
}
Error :
>javac Sub.java
Sub.java:11: modifier protected not allowed here
protected class Super
^
1 error
