MultipleChoice
Which code fragment causes a compilation error?
OptionsMultipleChoice
Which three statements are true about exception handling?
OptionsMultipleChoice
Given the code fragment:
Which code fragment, inserted at line n1, pints The Top element: 30?
OptionsMultipleChoice
Given:
And given the commands:
javac Test.java
java Test
What is the result?
OptionsMultipleChoice
Given the following class:
Which three pieces of code, when inserted independently, set the value of amount to 100?
OptionsMultipleChoice
Given the code fragments:
And,
Which statement is true?
OptionsMultipleChoice
Given the following class:
Which two changes would encapsulate this class and ensure that the area field is always equal to length * height whenever the Rectangle class is used?
OptionsMultipleChoice
Given the code fragment:
Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order?
OptionsMultipleChoice
Given:
class Test
int a1;
public static void doProduct(int a) {
a = a * a;
)
public static void doString(StringBuilder s) {
s.append('' '' + s);
}
public static void main(String[] args) {
Test item = new Test();
item.a1 = 11;
StringBuilder sb = new StringBuilder(''Hello'');
Integer i = 10;
doProduct(i);
doString(sb);
doProduct(item.a1);
System.out.println(i + '' '' + sb + '' '' + item.a1);
}
}
What is the result?
OptionsMultipleChoice
Which two class definitions fail to compile?
Options