网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
现有:   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


参考答案

参考解析
解析: 暂无解析
更多 “单选题现有:   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” 相关考题
考题 现金支出业务的处理程序为()。 A、1.指导填写凭证;2.出纳审核盖章;3.领导审批签字;4.出纳清点支付B、1.指导填写凭证;2.出纳清点支付;3.领导审批签字;4.出纳审核盖章C、1.指导填写凭证;2.领导审批签字;3.出纳审核盖章;4.出纳清点支付D、1.指导填写凭证;2.出纳审核盖章;3.出纳清点支付;4.领导审批签字

考题 战略对策具有以下特点:1.()2.()3.()4.()

考题 识读施工图的一般顺序不包括以下哪个()A、1.阅读图纸目录;2.阅读设计总说明;3.通读图纸;4.精读图纸B、1.阅读设计总说明;2.阅读图纸目录;3.通读图纸;4.精读图纸C、1.通读图纸;2.阅读设计总说明;3.阅读图纸目录;4.精读图纸D、1.阅读图纸目录;2.精读图纸;3.通读图纸;4.阅读设计总说明

考题 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.

考题 现有:  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. 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 AB、 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.

考题 常见的网上购物流程是()。A、1.查找商品2.提交订单3.放入购物车4.查看订单状态5.收货确认B、1.查找商品2.提交订单3.查看订单状态4.放入购物车5.收货确认C、1.查找商品2.放入购物车3.提交订单4.查看订单状态5.收货确认D、1.查找商品2.放入购物车3.提交订单4.收货确认5.查看订单状态

考题 写出分属于下列科的校园植物。 李亚科1.()2.()3.() 苹果亚科1.()2.()3.() 绣线菊亚科1.()2.() 蔷薇亚科() 十字花科1.()2.() 藜科1.()2.() 蓼科() 堇菜科() 卫矛科() 蝶形花科1.()2.()3.()

考题 1. public class Exception Test {  2. class TestException extends Exception {}  3. public void runTest() throws TestException {}  4. public void test() /* Point X */ {  5. runTest();  6. }  7. }  At Point X on line 4, which code is necessary to make the code compile?()  A、 No code is necessary.B、 throws ExceptionC、 catch ( Exception e )D、 throws RuntimeExceptionE、 catch ( TestException e)

考题 interface Animal {  void soundOff();  }  class Elephant implements Animal {  public void soundOff() {  System.out.println(“Trumpet”);  }  }  class Lion implements Animal {  public void soundOff() { System.out.println(“Roar”);  }  }  class Alpha1 {  static Animal get( String choice ) {  if ( choice.equalsIgnoreCase( “meat eater” )) {  return new Lion();  } else {  return new Elephant();  }  }  }  Which compiles?()  A、 new Animal().soundOff();B、 Elephant e = new Alpha1();C、 Lion 1 = Alpha.get(“meat eater”);D、 new Alpha1().get(“veggie”).soundOff();

考题 Given:  1.  public interface Foo {  2.  int k = 4:  3.  }   Which three are equivalent to line 2?()A、 final int k = 4:B、 public int k = 4:C、 static int k = 4:D、 private int k = 4:E、 abstract int k = 4:F、 volatile int k = 4:G、 transient int k = 4:H、 protected int k = 4:

考题 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、 testB、 nullC、 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.

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

考题 填空题根据各项耕作措施对土壤影响的大小及消耗动力的多少,土壤耕作措施可归纳为基本耕作和表土耕作。根据现有机具性能,其基本耕作措施有1.()2.()3.();三种。表土耕作包括1.浅耕灭茬2.耙地3.镇压4.中耕等作业。

考题 单选题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行的错误导致编译失败

考题 多选题现有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”? ()AdoX();BX.doX();Cx.X.doX();Dx.X myX = new x.X(); myX.doX();

考题 单选题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);

考题 单选题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: 8B  Compilation fails.C  Value is: 12D  Value is: -12E  The code runs with no output.F  An exception is thrown at runtime.

考题 多选题Given:  1.  public interface Foo {  2.  int k = 4:  3.  }   Which three are equivalent to line 2?()Afinal int k = 4:Bpublic int k = 4:Cstatic int k = 4:Dprivate int k = 4:Eabstract int k = 4:Fvolatile int k = 4:Gtransient int k = 4:Hprotected int k = 4:

考题 单选题1. interface A { public void aMethod(); }  2. interface B { public void bMethod(); }  3. interface C extends A,B { public void cMethod(); }  4. class D implements B {  5. public void bMethod() { }  6. }  7. class E extends D implements C {  8. public void aMethod() { }  9. public void bMethod() { }  10. public void cMethod() { }  11. }  What is the result?()A  Compilation fails because of an error in line 3.B  Compilation fails because of an error in line 7.C  Compilation fails because of an error in line 9.D  If you define D e = new E(), then e.bMethod() invokes the version of bMethod()defined in Line 5.E  If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 5.F  If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.

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

考题 单选题1. public class Exception Test {  2. class TestException extends Exception {}  3. public void runTest() throws TestException {}  4. public void test() /* Point X */ {  5. runTest();  6. }  7. }  At Point X on line 4, which code is necessary to make the code compile?()A  No code is necessary.B  throws ExceptionC  catch ( Exception e )D  throws RuntimeExceptionE  catch ( TestException e)

考题 单选题interface Animal {  void soundOff();  }  class Elephant implements Animal {  public void soundOff() {  System.out.println(“Trumpet”);  }  }  class Lion implements Animal {  public void soundOff() { System.out.println(“Roar”);  }  }  class Alpha1 {  static Animal get( String choice ) {  if ( choice.equalsIgnoreCase( “meat eater” )) {  return new Lion();  } else {  return new Elephant();  }  }  }  Which compiles?()A  new Animal().soundOff();B  Elephant e = new Alpha1();C  Lion 1 = Alpha.get(“meat eater”);D  new Alpha1().get(“veggie”).soundOff();

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

考题 单选题现有:  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 1B 2C 3D 4

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

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