关于类方法,实例方法的华为面试题
下列哪种说法是正确的( )。
A. 实例方法可直接调用超类的实例方法
B. 实例方法可直接调用超类的类方法
C. 实例方法可直接调用其他类的实例方法
D. 实例方法可直接调用本类的类方法
我写了个测试程序感觉abd都对呀 是不是我理解错了 希望大家各抒己见 谢谢
public class Test1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub B b = new B(); b.e(); }}class A { void c() { System.out.println("A"); } static void d() { System.out.println("static A"); }}class B extends A { void e() { c(); d(); }}