现有:   1. interface Altitude {   2.   //insert code here  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

 0

B

 1

C

 2

D

 3

E

 4

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

class One {  void foo() {}  }  class Two extends One {   //insert method here  }  Which three methods, inserted individually at line 14, will correctly complete class Two?()

  • A、 int foo() { /* more code here */ }
  • B、 void foo() { /* more code here */ }
  • C、 public void foo() { /* more code here */ }
  • D、 private void foo() { /* more code here */ }
  • E、 protected void foo() { /* more code here */ }

正确答案:B,C,E

第2题:

Given classes defined in two different files:  1. package util;  2. public class BitUtils {  3. private static void process(byte[] b) { }  4. }  1. package app;  2. public class SomeApp {  3. public static void main(String[] args) {  4. byte[] bytes = new byte[256];  5. // insert code here  6. }  7. }  What is required at line 5 in class SomeApp to use the process method of BitUtils?() 

  • A、 process(bytes);
  • B、 BitUtils.process(bytes);
  • C、 app.BitUtils.process(bytes);
  • D、 util.BitUtils.process(bytes);
  • E、 import util.BitUtils. *; process(bytes);
  • F、 SomeApp cannot use the process method in BitUtils.

正确答案:F

第3题:

1. public interface A {  2. public void doSomething(String thing);  3. }  1. public class AImpl implements A {  2. public void doSomething(String msg) { }  3. }  1. public class B {  2. public A doit() {  3. // more code here  4. }  5.  6. public String execute() { 7. // more code here  8. }  9. }  1. public class C extends B {  2. public AImpl doit() {  3. // more code here  4. }  5.  6. public Object execute() {  7. // more code here  8. }  9. }  Which statement is true about the classes and interfaces in the exhibit?() 

  • A、 Compilation will succeed for all classes and interfaces.
  • B、 Compilation of class C will fail because of an error in line 2.
  • C、 Compilation of class C will fail because of an error in line 6.
  • D、 Compilation of class AImpl will fail because of an error in line 2.

正确答案:C

第4题:

现有:   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、 0
  • B、 1
  • C、 2
  • D、 3
  • E、 4

正确答案:C

第5题:

11. public interface Status {  12. /* insert code here */ int MY_VALUE = 10;  13. }  Which three are valid on line 12?()

  • A、 final
  • B、 static
  • C、 native
  • D、 public
  • E、 private
  • F、 abstract
  • G、 protected

正确答案:A,B,D

第6题:

interface Altitude {  //insert code here   }   和4个声明:   int HIGH = 7;  public int HIGH = 7;    abstract int HIGH = 7;   interface int HIGH = 7;  分别插入到第2行,有多少行可以编译?()  

  • A、 0
  • B、 1
  • C、 2
  • D、 3
  • E、 4

正确答案:C

第7题:

现自:  1.  interface Color {  }      2. interface Weight  {  }      3.  //insert code here    和以下足六个声明:  class Boat extends Color, extends Weight  {  }     class Boat extends Color and Weight  {  }      class Boat extends Color, Weight  {  }  class Boat implements Color,  implements Weight  {  }     class Boat implements Color and Weight  {  }      class Boat implements Color, Weight  {  }    分别插入到第3行,有多少行可以编译? () 

  • A、  0
  • B、  1
  • C、  2
  • D、  3

正确答案:B

第8题:

现有:  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、  0
  • B、  1
  • C、  2
  • D、  3

正确答案:C

第9题:

Given 11.public interface Status { 12./* insert code here */ int MY_VALUE = 10; 13.} Which three are valid on line 12?()

  • A、final
  • B、static
  • C、native
  • D、public
  • E、private

正确答案:A,B,D

第10题:

单选题
interface Altitude {  //insert code here   }   和4个声明:   int HIGH = 7;  public int HIGH = 7;    abstract int HIGH = 7;   interface int HIGH = 7;  分别插入到第2行,有多少行可以编译?()
A

 0

B

 1

C

 2

D

 3

E

 4


正确答案: B
解析: 暂无解析

更多相关问题