a = new A();
A[] a = new A[];
A[] a = new A[10];
以上皆错
第1题:
interface 声明一个接口时,成员方法默认的修饰符是()
A. private
B. 友好的
C. abstract
D. public abstract
第2题:
现有: public interface A {} 以下哪项声明是合法的?()
第3题:
Which three demonstrate an “is a” relationship?()
第4题:
以下声明合法的是()
第5题:
现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?()
第6题:
Which two demonstrate an “is a” relationship?()
第7题:
现有: 1. interface Altitude { 2. //insert code here 3. } 和4个声明: int HIGH = 7; public int HIGH = 7; abstract int HIGH = 7; interface int HIGH = 7; 分别插入到第2行,有多少行可以编译?()
第8题:
A a = new A();
A[] a = new A[];
A[] a = new A[10];
以上皆错
第9题:
public class X { } public class Y extends X { }
public interface Shape { } public interface Rectangle extends Shape{ }
public interface Color { } public class Shape { private Color color; }
public interface Species { } public class Animal { private Species species; }
public class Person { } public class Employee { public Employee(Person person) { }
interface Component { } class Container implements Component { private Component[] children; }
第10题:
public interface Person {} Public class Employee extends Person {}
public interface Shape {} public interface Rectangle extends Shape {}
public interface Color {} public class Shape { private Color color; }
public class Species {} public class Animal { private Species species; }
interface Component {} Class Container implements Component {private Component [] children;
第11题:
0
1
2
3
第12题:
0
1
2
3
4
第13题:
public interface A { String DEFAULT_GREETING = “Hello World”; public void method1(); } A programmer wants to create an interface called B that has A as its parent. Which interface declaration is correct?()
第14题:
现有: 1. interface Animal f 2. void eat(); 3. } 4. 5. // insert code here 6. 7. public class HouseCat implements Feline { 8. public void eat() { } 9. } 和以下三个接口声明: interface Feline extends Animal ( ) interface Feline extends Animal {void eat(); } interface Feline extends Animal {void eat() { } } 分别插入到第5行,有多少行可以编译?
第15题:
在使用interface声明一个接口时,只可以使用()修饰符修饰该接口。
第16题:
main方法是Java程序执行的入口点,关于main方法的方法头以下哪项是合法的()?
第17题:
Which the two demonstrate an “is a” relationship?()
第18题:
现有 public class Parentt public void change (int x){) ) public class Child extends Parent{ //覆盖父类change方法 } 下列哪个声明是正确的覆盖了父类的change方法?()
第19题:
外部SYSTEM声明
外部PUBLIC声明
内部声明
实体声明
第20题:
public class Employee implements Info extends Data { public void load(){/*dosomething*/} }
public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }
public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }
public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
第21题:
0
1
2
3
第22题:
public interface B extends A {}
public interface B implements A {}
public interface B instanceOf A {}
public interface B inheritsFrom A {}
第23题:
0
1
2
3