Consider the following classes in Java
class A
{
protected void methodA()
{
System.out.println("methodA() in A");
}
}
class B extends A
{
protected void methodA() // overrides methodA()
{
System.out.println("methodA() in B");
}
protected void methodB()
{
}
}
public class C extends B // needs the functionality of methodB()
{
public void methodC()
{
methodA(); // prints "methodA() in B"
}
}
How do I call the methodA() in a from methodC() in class C? Is that possible?