单选题Click the Exhibit button. What is the result?()A Value is: 8B Compilation fails.C Value is: 12D Value is: -12

题目
单选题
Click the Exhibit button. What is the result?()
A

Value is: 8

B

Compilation fails.

C

Value is: 12

D

Value is: -12

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

第1题:

Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result? ()

A.Compilation fails.

B.ClassC is displayed.

C.The code runs with no output.

D.An exception is thrown at runtime.


参考答案:D

第2题:

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

第3题:

Given:What is the result?()

A.Compilation fails.

B.exception is thrown at runtime.

C.The attribute id in the ItemTest object remains unchanged.

D.The attribute id in the ItemTest object is modified to the new value.

E.A new ItemTest object is created with the preferred value in the id attribute.


参考答案:A

第4题:

public class Foo {  public int a;  public Foo() { a = 3; }  public void addFive() { a += 5; }  }  and:  public class Bar extends Foo { public int a;  public Bar() { a = 8; }  public void addFive() { this.a +=5; }  }  invoked with:  Foo foo = new Bar();  foo.addFive();  System.out.println(”Value: “+ foo.a);  What is the result?() 

  • A、 Value: 3
  • B、 Value: 8
  • C、 Value: 13
  • D、 Compilation fails.
  • E、 The code runs with no output.
  • F、 An exception is thrown at runtime.

正确答案:A

第5题:

12. String csv = “Sue,5,true,3”;  13. Scanner scanner = new Scanner( csv);  14. scanner.useDelimiter(”,”);  15. int age = scanner.nextInt();  What is the result?() 

  • A、 Compilation fails.
  • B、 After line 15, the value of age is 5.
  • C、 After line 15, the value of age is 3.
  • D、 An exception is thrown at runtime.

正确答案:D

第6题:

Examine the exhibit to view the parameters set in your parameter file. (Click the Exhibit(s) button.)You restart the instance.To what value will the MEMORY_MAX_TARGET parameter be set by default?()

A.120M

B.320M

C.480M

D.600M


参考答案:D

第7题:

11. public void someMethod(Object value) {  12. // check for null value ....  20. System.out.println(value.getClass());  21. }  What, inserted at line 12, is the appropriate way to handle a null value?() 

  • A、 assert value == null;
  • B、 assert value !null, “value is null”;
  • C、 if (value == null) { throw new AssertionException(”value is null”);
  • D、 if (value == null) { throw new IllegalArgumentException(”value is null”);

正确答案:D

第8题:

Click the Exhibit button. 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

第9题:

public class ClassA {  public int getValue() {  int value=0;  boolean setting = true;  String title=”Hello”;  (value || (setting && title == “Hello”)) { return 1; }  (value == 1 & title.equals(”Hello”)) { return 2; }  }  } And:  ClassA a = new ClassA();  a.getValue();  What is the result?() 

  • A、 1
  • B、 2
  • C、 Compilation fails.
  • D、 The code runs with no output.
  • E、 An exception is thrown at runtime.

正确答案:C

第10题:

Examine the exhibit to view the parameters set in your parameter file. (Click the Exhibit(s) button.) You restart the instance. To what value will the MEMORY_MAX_TARGET parameter be set by default?()

  • A、120M
  • B、320M
  • C、480M
  • D、600M

正确答案:D

更多相关问题