posted 23 years ago
Here's an example:
public class Shape{
public void draw(Graphics g){
return shape;
}
}
public class Circle extends Shape{
public void draw(Graphics g){
return Circle;
}
}
public class Oval extends Circle{
public void draw(Graphics g){
return Oval;
}
}
Okay, now the draw method from Shape has been overridden more than once: by the Circle class, and the Oval class. Any member from the Circle class could access Shape's draw method with super.draw(Graphics g). But no member from the oval class can access the draw method in Shape, but it could access the draw method from Circle with the super.draw(Graphics g). So for overridden methods, you can only directly access one up on the hierarchy. There is no way you can access more than one level up directly. I hope this helps. Let me know if you still have questions.