代码如下:
public class Test99 {
private String a="a";
protected void test99Method(){
System.out.println(a);
}
} class Test99b extends  Test99{
 private String b="b";
 protected void test99Method(){
 System.out.println(b);
 super.test99Method();
 }
}
 
 class Test99c extends Test99b{
 private String c="c";
 protected void test99Method(){
 System.out.println(c);
 //我这里想调用Test99中的test99Method()方法而非Test99b中的。请高手帮忙。
 }
 }

解决方案 »

  1.   

    public class Test99 {
               private String a="a";
               protected void test99Method(){
                       System.out.println(a);
               }
       }    class Test99b extends  Test99{
                private String b="b";
                protected void test99Method(){
                        System.out.println(b);
                        super.test99Method();
                }
                protected void test99Method1(){                super.test99Method();
            }\\这里写个函数嵌套调用好了   }    class Test99c extends Test99b{
                private String c="c";
                protected void test99Method(){
                        System.out.println(c);
                        super.test99Method1();
                        
                }
      

  2.   

    那样的话class Test99c不得可以直接继承Test99,而不用继承Test99b了
      

  3.   

    不是我的代码有问题,比如说JJTextField要重写JDK中processKeyEvent方法。而JJTextField又扩展自JComponent,JComponent中的processKeyEvent方法扩展自Component的。
    我在这里的想法就是在JJTextField自已扩展Componentr的processKeyEvent方法而跳过JComponent中的那些步骤。
      

  4.   

    easyroom(风) 说的有道理,没有必要覆盖。