题目内容

Given a pre-generics implementation of a method: What three changes allow the class to be used with generics and avoid an unchecked warning?()

A. Remove line 14.
B. Replace line 14 with "int i = iter.next();".
C. Replace line 13 with "for (int i : intList) {".
D. Replace line 13 with "for (Iterator iter : intList) {".
E. Replace the method declaration with "sum(List

查看答案
更多问题

What is the result?()

A. Compilation fails.
B. An exception is thrown at runtime.
C. doStuff x=6,main x=6
D. doStuff x=5,main x=5
E. doStuff x=5,main x=6
F. doStuff x=6,main x=5

Given: What is the result?()

A. Compilation fails due to an error in line 23.
B. Compilation fails due to an error in line 29.
C. A ClassCastException occurs in line 29.
D. A ClassCastException occurs in line 31.
E. The value of all four objects prints in natural order.

What is true regarding a transaction executed in Automatic Undo Management mode?()

A
B
C
D

Given a class Repetition: Which code should be inserted at line 1 of Demo.java to compile and run Demo to print "pizzapizza"?()

A. import utils.*;
B. static import utils.*;
C. import utils.Repetition.*;
D. static import utils.Repetition.*;
E. import utils.Repetition.twice();
F. import static utils.Repetition.twice;

答案查题题库