下列关于接口的定义哪项是正确的? A. interface C{int a;) B. public interface A implements B {) C. public interface A {int a(); ) D. abstract interface D {)
A: interface C{int a;}
B: public interface A implements B {}
C: public interface A {int a(); }
D: abstract interface D {}
A: interface C{int a;}
B: public interface A implements B {}
C: public interface A {int a(); }
D: abstract interface D {}
举一反三
- 请看下列代码:public interface A {String DEFAULT_GREETING = “Hello World”;public void method1();}现有接口B,是A接口的子接口,下列选择中B接口的声明正确的是: A: public interface B extends A { } B: public interface B implements A {} C: public interface B instanceOf A {} D: public interface B inheritsFrom A { }
- 下列能正确定义一个接口的选项是( ) 。 A: abstract interface A{ int a; } B: interface B{ void show(){} } C: interface C{ void show();} D: interface class D{ String d; }
- 请看下列代码public interface A {String default Green= "helloworld";public void method();}现有接口B,是A接品的子接口,下列选择中B接品的声明正确的是() A: public interface B extends A{} B: public interface B implements A{} C: public interface B instanceOf A{}
- 程序填空:interface Com{ int M=200; int f(); } class ImpCom implements Com{ ___________________________; } A: public int f(){retrun 100+M;} B: int f() {return 100;} C: public double f(){return 2.6;} D: public abstract inf f();
- 下列能正确定义一个接口的选项是: A: abstract interface A{int a;} B: interface B{void show(){};} C: interface C{void show();} D: implement D{String d;}