下面哪些语法结构是不正确的( )
A: public class A extends B implements C
B: public class A implement A B
C: public class A implements B,C,D
D: public class A implements B
A: public class A extends B implements C
B: public class A implement A B
C: public class A implements B,C,D
D: public class A implements B
举一反三
- 假设C和D是接口,下列定义哪个是正确的() A: public class A implements C,D{ } B: public class A implements C implements D{ } C: public class A extends C,D{ } D: public class A extends C extends D{ }
- A类同时实现接口B和接口C,正确的写法是: A: public class A implements B, implements C {...} B: public class A implements B, C {...} C: public class A interface B, iinterface C {...} D: public class A extends B, C {...}
- 下列哪个方法可用于创建一个可运行的类X? A: public class X implements Runnable{ public void run(){......} } B: public class X implements Thread{ public void run(){......} } C: public class X implements Thread{ public int run(){......} } D: public class X extends Runnable{ public void run(){......} }
- (1+X)假设 C 是抽象类,I1 和 I2 是接口。下列关于抽象类或接口的定义,哪一个是正确的( )。 A: public class A extends C implements I1,I2{} B: public class A extends I1,I2 implements C{} C: public class A implements I1,I2 extends C {} D: public class A extends C, I1, I2 {}
- 下列关于Test类的定义代码中,正确的是______。 A: class Test implements Runnable { public void run() {} public void someMethod() {} } B: class Test implements Runnable { public void run(); } C: class Test implements Runnable { public void someMethod(); } D: class Test implements Runnable { public void someMethod() {} }