单选题现有:  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 {

题目
单选题
现有:  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

0

B

1

C

2

D

3


相似考题
更多“现有:  1. interface Animal {  2. void eat();  3. }  4.  5. // ”相关问题
  • 第1题:

    现有:  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

  • 第2题:

    1. public class A {  2. void A() {  3. System.out.println(“Class A”);  4. }  5. public static void main(String[] args) {  6. new A();  7. }  8. }  What is the result?()  

    • A、 Class A
    • B、 Compilation fails.
    • C、 An exception is thrown at line 2.
    • D、 An exception is thrown at line 6.
    • E、 The code executes with no output.

    正确答案:E

  • 第3题:

    分析下列汉字音节结构。 1.摆 2.皇 3.卫 4.惘 5.情


    正确答案: 1、摆声母是b韵腹是a声调的调类是上升,调值是214。
    2、皇声母是h韵头是u,韵腹是a,声调的调类是阳平,调值是35。
    3、卫韵头是u,韵腹是e,声调的调类是去声,调值是51。
    4、惘韵头是u,韵腹是a,声调的调类是上升,调值是214。
    5、情声母是q,韵腹是I,声调的调类是阳平,调值是35。

  • 第4题:

    露地观赏植物可分1.()2.()3.()4.()5.().


    正确答案:一年生花卉、二年生花卉、多年生花卉、水生花卉、岩生花卉

  • 第5题:

    填空题
    汽车冷气机之主件可分:1.()2.()3.()4.()和干燥器5.()开关。

    正确答案: 挥发器,冷凝器,压缩机,储液器,膨胀
    解析: 暂无解析

  • 第6题:

    多选题
    现有2 个文件:  1. package x;  2. public class X {  3. public static void doX() { System.out.print("doX "); }  4. }  和:  1. class Find {  2. public static void main(String [] args) {  3. //insert code here  4. }  5. }  哪两行分别插入到类Find 的第3 行将编译并产生输出“doX”? ()
    A

    doX();

    B

    X.doX();

    C

    x.X.doX();

    D

    x.X myX = new x.X(); myX.doX();


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

  • 第7题:

    单选题
    1. public class Test {  2. public static void main (String []args)  {  3. unsigned byte b = 0;  4. b--;  5.     6.   }  7. }   What is the value of b at line 5?()
    A

     -1

    B

     255

    C

     127

    D

     Compilation will fail.

    E

     Compilation will succeed but the program will throw an exception at line 4.


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

  • 第8题:

    单选题
    现有:  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

    0

    B

    1

    C

    2

    D

    3


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

  • 第9题:

    单选题
    1. public class A {  2. void A() {  3. System.out.println(“Class A”);  4. }  5. public static void main(String[] args) {  6. new A();  7. }  8. }  What is the result?()
    A

     Class A

    B

     Compilation fails.

    C

     An exception is thrown at line 2.

    D

     An exception is thrown at line 6.

    E

     The code executes with no output.


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

  • 第10题:

    单选题
    现有:  interface Animal {       void eat () ;       }       //insert code here       public class HouseCat extends Feline {       public void eat() { }       }  和五个申明  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();} 结果为:()
    A

    1

    B

    2

    C

    3

    D

    4


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

  • 第11题:

    单选题
    1. class Animal { Animal getOne() { return new Animal(); } }  2. class Dog extends Animal {  3. // insert code here   4. }  5.  6. class AnimalTest {  7. public static void main(String [] args) {  8. Animal [] animal = { new Animal(), new Dog() } ;  9. for( Animal a : animal) {  10. Animal x = a.getOne();  11. }  12. }  13. }  和代码:  3a. Dog getOne() {  return new Dog();  }  3b. Animal getOne() {  return new Dog();  }  第 3 行中插入的哪项将编译且运行无异常?()
    A

    3a行

    B

    3b行

    C

    3a行或3b行

    D

    既非3a,也非3b


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

  • 第12题:

    填空题
    物候观测应做到:1.定点;2.();3.定时、定年限;4.();5.资料整理。

    正确答案: 定株,定人
    解析: 暂无解析

  • 第13题:

    1. public class Test {   2. public static void main (String args) {   3. unsigned byte b = 0;   4. b--;   5.   6. }   7. }   What is the value of b at line 5?()  

    • A、 -1
    • B、 255
    • C、 127
    • D、 Compilation will fail.
    • E、 Compilation will succeed but the program will throw an exception at line 4.

    正确答案:D

  • 第14题:

    常见的网上购物流程是()。

    • A、1.查找商品>2.提交订单>3.放入购物车>4.查看订单状态>5.收货确认
    • B、1.查找商品>2.提交订单>3.查看订单状态>4.放入购物车>5.收货确认
    • C、1.查找商品>2.放入购物车>3.提交订单>4.查看订单状态>5.收货确认
    • D、1.查找商品>2.放入购物车>3.提交订单>4.收货确认>5.查看订单状态

    正确答案:C

  • 第15题:

    观赏植物根据观赏部位分类可分为1.()2.()3.()4.()5.().


    正确答案:观花类、观叶类、观茎类、观果类、观芽类

  • 第16题:

    1. interface TestA { String toString(); }  2. public class Test {  3. public static void main(String[] args) {  4. System.out.println(new TestA() {  5. public String toString() { return “test”; }  6. }  7. }  8. }  What is the result?() 

    • A、 test
    • B、 null
    • C、 An exception is thrown at runtime.
    • D、 Compilation fails because of an error in line 1.
    • E、 Compilation fails because of an error in line 4.
    • F、 Compilation fails because of an error in line 5.

    正确答案:A

  • 第17题:

    单选题
    1. interface I { void go(); }   2.   3. abstract class A implements I { }  4.   5. class C extends A {   6. void go(){ }   7. }   结果是什么?()
    A

    代码通过编译

    B

    由于多个错误导致编译失败

    C

    由于第1行的错误导致编译失败

    D

    由于第6行的错误导致编译失败


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

  • 第18题:

    单选题
    Given classes defined in two different files:  1. package util;  2. public class BitUtils {  3. public static void process(byte[]) { /* more code here */ }  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

     util.BitUtils.process(bytes);

    D

     SomeApp cannot use methods in BitUtils.

    E

     import util.BitUtils.*; process(bytes);


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

  • 第19题:

    单选题
    1. public class SimpleCalc {  2. public int value;  3. public void calculate() { value += 7; }  4. } And:  1. public class MultiCalc extends SimpleCalc {  2. public void calculate() { value -= 3; }  3. public void calculate(int multiplier) {  4. calculate();  5. super.calculate();  6. value *=multiplier;  7. }  8. public static void main(String[] args) {  9. MultiCalc calculator = new MultiCalc();  10. calculator.calculate(2);  11. System.out.println(”Value is: “+ calculator.value);  12. }  13. }  What is the result?()
    A

     Value is: 8

    B

     Compilation fails.

    C

     Value is: 12

    D

     Value is: -12

    E

     The code runs with no output.

    F

     An exception is thrown at runtime.


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

  • 第20题:

    多选题
    1. public class A {  2. public void method1() {  3. B b=new B();  4. b.method2();  5. // more code here  6. }  7. }  1. public class B {  2. public void method2() {  3.C c=new C();  4. c.method3();  5. // more code here  6. }  7. }  1. public class C {  2. public void method3() {  3. // more code here  4. }  5. }  Given:  25. try {  26. A a=new A();  27. a.method1();  28. } catch (Exception e) {  29. System.out.print(”an error occurred”);  30. }  Which two are true if a NullPointerException is thrown on line 3 of class C?()
    A

    The application will crash.

    B

    The code on line 29 will be executed.

    C

    The code on line 5 of class A will execute.

    D

    The code on line 5 of class B will execute.

    E

    The exception will be propagated back to line 27.


    正确答案: D,C
    解析: 暂无解析

  • 第21题:

    单选题
    现有:  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
    解析: 暂无解析

  • 第22题:

    单选题
    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

    0

    B

    1

    C

    2

    D

    3


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

  • 第23题:

    填空题
    观赏植物根据观赏部位分类可分为1.()2.()3.()4.()5.().

    正确答案: 观花类、观叶类、观茎类、观果类、观芽类
    解析: 暂无解析

  • 第24题:

    填空题
    露地观赏植物可分1.()2.()3.()4.()5.().

    正确答案: 一年生花卉、二年生花卉、多年生花卉、水生花卉、岩生花卉
    解析: 暂无解析