Value is: 8
Compilation fails.
Value is: 12
Value is: -12
第1题:
A.Compilation fails.
B.ClassC is displayed.
C.The code runs with no output.
D.An exception is thrown at runtime.
第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?()
第3题:
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.
第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?()
第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?()
第6题:
A.120M
B.320M
C.480M
D.600M
第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?()
第8题:
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.
第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?()
第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?()