多选题Which statements concerning the relationships between the following classes are true?()   class Foo {  int num;   Baz comp = new Baz();   }   class Bar {  boolean flag;   }   class Baz extends Foo {   Bar thing = new Bar();   double limit;   }AA Bar is

题目
多选题
Which statements concerning the relationships between the following classes are true?()   class Foo {  int num;   Baz comp = new Baz();   }   class Bar {  boolean flag;   }   class Baz extends Foo {   Bar thing = new Bar();   double limit;   }
A

A Bar is a Baz.

B

A Foo has a Bar.

C

A Baz is a Foo.

D

A Foo is a Baz.

E

A Baz has a Bar.

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

第1题:

关于以下初始化序列的执行结果的说法正确的是( )。 int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz=bar+index;

A.baz的值为0

B.baz的值为1

C.编译通过,但产生异常

D.编译不能通过


正确答案:B

第2题:

10. interface Foo { int bar(); }  11. public class Sprite {  12. public int fubar( Foo foo) { return foo.bar(); }  13. public void testFoo() {  14. fubar(  15. // insert code here  16.);  17. }  18. }  Which code, inserted at line 15, allows the class Sprite to compile?() 

  • A、 Foo { public int bar() { return 1; } }
  • B、 new Foo { public int bar() { return 1; } }
  • C、 newFoo() { public int bar(){return 1; } }
  • D、 new class Foo { public int bar() { return 1; } }

正确答案:C

第3题:

Given:Which code, inserted at line 15, allows the class Sprite to compile?()

A.Foo { public int bar() { return 1; }

B.new Foo { public int bar() { return 1; }

C.new Foo() { public int bar() { return 1; }

D.new class Foo { public int bar() { return 1; }


参考答案:C

第4题:

Which code determines the int value foo closest to a double value bar?()  

  • A、 Int foo = (int) Math.max(bar);
  • B、 Int foo = (int) Math.min(bar);
  • C、 Int foo = (int) Math.abs(bar);
  • D、 Int foo = (int) Math.ceil(bar);
  • E、 Int foo = (int) Math.floor(bar);
  • F、 Int foo = (int) Math.round(bar);

正确答案:F

第5题:

Given the security constraint in a DD:// 101. 102. 103.Foo 104./Bar/Baz/* 105.POST 106. 107. 108.DEVELOPER 109. 110. And given that "MANAGER" is a valid role-name,which four are true for this security constraint?()

  • A、MANAGER can do a GET on resources in the /Bar/Baz directory.
  • B、MANAGER can do a POST on any resource in the /Bar/Baz directory.
  • C、MANAGER can do a TRACE on any resource in the /Bar/Baz directory.
  • D、DEVELOPER can do a GET on resources in the /Bar/Baz directory.
  • E、DEVELOPER can do only a POST on resources in the /Bar/Baz directory.
  • F、DEVELOPER can do a TRACE on any resource in the /Bar/Baz directory.

正确答案:A,C,D,F

第6题:

下列程序执行后,baz的值应是 int index=1; int fox[ ]=new int[3]; Int bar=fox[index]; int baz:bar+index;

A.0

B.1

C.2

D.编译错误


正确答案:B
解析:intfox[]=newint[3];这时数组的每个元素都初始化为0,所以intbaz=bar+index;其实,这时bar的值是0,这样便有baz的值1。

第7题:

package foo; public class Outer (  public static class Inner (  )  )   Which statement is true? () 

  • A、 An instance of the Inner class can be constructed with “new Outer.Inner ()”
  • B、 An instance of the inner class cannot be constructed outside of package foo.
  • C、 An instance of the inner class can only be constructed from within the outer class.
  • D、 From within the package bar, an instance of the inner class can be constructed with “new inner()”

正确答案:A

第8题:

下面程序执行后,baz的值应是______。 public class Test9 { public static void main(String[] args) { int index = 1; int fox[] = new int [3]; iht bar = fox [index]; int baz = bar + index; System.out.println(baz); } }

A.0

B.1

C.2

D.编译错误


正确答案:B
解析:int fox[]=new int[3]这时数组的每个元素都初始化为0,所以int baz=bar+index;,其实,这时bar的值为0,这样便有baz的值为1。

第9题:

public class Test {  public static void main( String[] args) {  String foo = args[1];  String bar = args[2];  String baz = args[3];  System.out.println(“baz = “ + baz); }  }   And the command line invocation: java Test red green blue   What is the result?()  

  • A、 baz =
  • B、 baz = null
  • C、 baz = blue
  • D、 Compilation fails.
  • E、 An exception is thrown at runtime.

正确答案:E

第10题:

public class Test {  public static void main (String[]args) {  String foo = args[1];  String bar = args[2];  String baz = args[3];  System.out.printIn(“baz = ” + baz);  }  }  And the output:  Baz = 2  Which command line invocation will produce the output?()  

  • A、 Java Test 2222
  • B、 Java Test 1 2 3 4
  • C、 Java Test 4 2 4 2
  • D、 Java Test 4 3 2 1

正确答案:C

更多相关问题