class A
{
public void display()
{
System.out.println("Class A display!!!");
}
}
class B extends A
{
public void display()
{
System.out.println("Class B display!!!");
}
}
class C extends B
{
public void display()
{
System.out.println("Class C display!!!");
super.display(); // will call B's display() method
// how to call A's display() method here?
}
}
public static void main(String args[])
{
C obj = new C();
obj.display(); // will call C's display() method
}
}
How can I call A
's display()
method from C
's display()
method? Is it possible to somehow call A
's display()
method using super
?