Hello,
The bellow is one of the rules for overriding a method.
�The access level can be less restrictive than that of the overridden method.�
If I try to run the following class it gives the error message. Pls let me know what am I missing.
�Over.java :14: amethod(int) has private access in Base0.amethod(iBase);�
class Base
{
private void amethod(int iBase)
{
System.out.println("Base.amethod()");
}
}
class Over extends Base
{
public static void main(
String argv[])
{
Over o = new Over();
int iBase = 0;
o.amethod(iBase);
}
public void amthod(int iOver)
{
System.out.println("Over.amethod()");
}
}