网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
现有: public interface A {} 以下哪项声明是合法的?()
A
a = new A();
B
A[] a = new A[];
C
A[] a = new A[10];
D
以上皆错
参考答案
参考解析
解析:
暂无解析
更多 “单选题现有: public interface A {} 以下哪项声明是合法的?()A a = new A();B A[] a = new A[];C A[] a = new A[10];D 以上皆错” 相关考题
考题
下列哪个类声明是正确的? ( )A.abstract class G2 extends superClass1,superClass2{...}B.abstract public class classmates{...}C.public final class NewClass extends superClass implemnets Interface1{...}D.public abstract class String{...}
考题
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?() A、 public interface B extends A {}B、 public interface B implements A {}C、 public interface B instanceOf A {}D、 public interface B inheritsFrom A {}
考题
现有: public interface A {} 以下哪项声明是合法的?() A、a = new A();B、 A[] a = new A[];C、 A[] a = new A[10];D、 以上皆错
考题
现有: 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行,有多少行可以编译? A、 0B、 1C、 2D、 3
考题
Which three demonstrate an “is a” relationship?() A、 public class X { } public class Y extends X { }B、 public interface Shape { } public interface Rectangle extends Shape{ }C、 public interface Color { } public class Shape { private Color color; }D、 public interface Species { } public class Animal { private Species species; }E、 public class Person { } public class Employee { public Employee(Person person) { }F、 interface Component { } class Container implements Component { private Component[] children; }
考题
以下声明合法的是()A、default String sB、public final static native int w( )C、abstract double dD、abstract final double hyperbolicCosine( )
考题
main方法是Java程序执行的入口点,关于main方法的方法头以下哪项是合法的()?A、public static void main( )B、public static void main( String args[] )C、public static int main(String [] arg )D、public void main(String arg[] )
考题
现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?() A、 public class Employee implements Info extends Data { public void load(){/*dosomething*/} }B、public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }C、public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }D、public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
考题
Which the two demonstrate an “is a” relationship?()A、 public interface Person {} Public class Employee extends Person {}B、 public interface Shape {} public interface Rectangle extends Shape {}C、 public interface Color {} public class Shape { private Color color; }D、 public class Species {} public class Animal { private Species species; }E、 interface Component {} Class Container implements Component {private Component [] children;
考题
Which two demonstrate an “is a” relationship?() A、 public interface Person { } public class Employee extends Person { }B、 public interface Shape { } public class Employee extends Shape { }C、 public interface Color { } public class Employee extends Color { }D、 public class Species { } public class Animal (private Species species;)E、 interface Component { } Class Container implements Component ( Private Component[ ]children; )
考题
现有 public class Parentt public void change (int x){) ) public class Child extends Parent{ //覆盖父类change方法 } 下列哪个声明是正确的覆盖了父类的change方法?() A、 protected void change (int x){}B、 public void change(int x, int y){}C、 public void change (int x){}D、 public void change (String s){}
考题
现有: 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行,有多少行可以编译?() A、 0B、 1C、 2D、 3E、 4
考题
单选题现有: public interface A {} 以下哪项声明是合法的?()A
A a = new A();B
A[] a = new A[];C
A[] a = new A[10];D
以上皆错
考题
单选题现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?()A
public class Employee implements Info extends Data { public void load(){/*dosomething*/} }B
public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }C
public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }D
public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
考题
多选题Which three demonstrate an “is a” relationship?()Apublic class X { } public class Y extends X { }Bpublic interface Shape { } public interface Rectangle extends Shape{ }Cpublic interface Color { } public class Shape { private Color color; }Dpublic interface Species { } public class Animal { private Species species; }Epublic class Person { } public class Employee { public Employee(Person person) { }Finterface Component { } class Container implements Component { private Component[] children; }
考题
单选题现有: 1. interface Animal { 2. void eat(); 3. } 4. 5. // insert code here 6. 7. public class HouseCat extends Feline { 8. public void eat() { } 9. } 和五个声明: abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat(); } abstract class Feline implements Animal { public void eat(); } abstract class Feline implements Animal { public void eat() { } } abstract class Feline implements Animal { abstract public void eat(); } 分别插入到第5行,有几个可以通过编译?()A
0B
1C
2D
3
考题
多选题Which the two demonstrate an “is a” relationship?()Apublic interface Person {} Public class Employee extends Person {}Bpublic interface Shape {} public interface Rectangle extends Shape {}Cpublic interface Color {} public class Shape { private Color color; }Dpublic class Species {} public class Animal { private Species species; }Einterface Component {} Class Container implements Component {private Component [] children;
考题
单选题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?()A
public interface B extends A {}B
public interface B implements A {}C
public interface B instanceOf A {}D
public interface B inheritsFrom A {}
考题
单选题现有: 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行,有多少行可以编译?A
0B
1C
2D
3
考题
单选题1. interface Animal { 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 行,有多少行可以编译?()A
0B
1C
2D
3
考题
单选题现有: 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行,有多少行可以编译?()A
0B
1C
2D
3E
4
热门标签
最新试卷