Hi,
This is from JQPlus free mock exam:
class SuperClass
{
public void methodA()
{
System.out.println("In superclass's method A");
methodB(); //0
}
private void methodB()
//public void methodB()
{
System.out.println("In superclass's method B");
}
}
class SubClass extends SuperClass
{
public void methodB()
{
System.out.println("In subclass's method B ");
}
public static void main(
String args[])
{
SuperClass obj = new SubClass();
obj.methodA();
}
}
1.Is it so that is not possible to override private functions?
2.Is there a way in which I can call the SubClass methodB - just curiosity?