Kira Yamato <> writes:
> class A
> {
> public int showMe() { System.out.println("A"); }
> }
>
> class B extends A
> {
> public int showMe() { System.out.println("B"); }
> }
>
> class C extends A
You mean "extends B" for the question to make sense.
> {
> public int showMe() { System.out.println("C"); }
>
> public void test()
> {
> showMe(); // prints C
> super.showMe(); // prints B
>
> // Question: how can I access class A's showMe()?
You can't.
Perhaps using reflection, but that's sidestepping a restriction
that is there for a reason.
A more relevant question is: Why do you want to? Should you instead
change your model or class hierarchy so that it matches what you want
to do with it?
> // I'm suspecting this cannot be done without modifying codes
> outside of class C.
Correct.
/L
--
Lasse Reichstein Nielsen -
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'