Given:
Which code, inserted at line 4, guarantees that this program will output [1, 2]()?
A.Set set = new TreeSet();
B.Set set = new HashSet();
C.Set set = new SortedSet();
D.List set = new SortedList();
E.Set set = new LinkedHashSet();
您可能感兴趣的试卷
你可能感兴趣的试题
A.The class implements java.lang.Comparable.
B.The class implements java.util.Comparator.
C.The interface used to implement sorting allows this class to define only one sort sequence.
D.The interface used to implement sorting allows this class to define many different sort sequences.
Given:
What is the result?()
A.0
B.1
C.2
D.3
E.4
F.Compilation fails.
G.An exception is thrown at runtime.
Given:
What is the result?()
A.7
B.49
C.343
D.Compilation fails.
E.An exception is thrown at runtime.
Given:
What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()
A. It is true that j==i.
B. It is false that j==i.
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 13.
Given:
What is the result?()
A.abc
B.123
C.a1b2c3
D.a1
E.Compilation fails.
F.The code runs with no output.
G.An exception is thrown at runtime
Given:
Which two statements are true about the result if the default locale is Locale.US?()
A.The value of b is 2.
B.The value of a is 3.14.
C.The value of b is 2.00.
D.The value of a is 3.141.
E.The value of a is 3.1415.
F.The value of a is 3.1416.
G.The value of b is 2.0000.
Given:
What is the result?()
A.2
B.3
C.4
D.6
E.7
Given:
What is the result?()
A.Compilation succeeds.
B.Exactly one class does NOT compile.
C.Exactly two classes do NOT compile.
D.Exactly four classes do NOT compile.
E.Exactly three classes do NOT compile.
Click the Exhibit button. Which statement is true about the classes and interfaces in the exhibit?()
A.Compilation will succeed for all classes and interfaces.
B.Compilation of class C will fail because of an error in line 2.
C.Compilation of class C will fail because of an error in line 6.
D.Compilation of class AImpl will fail because of an error in line 2
Given:
Which three methods, inserted individually at line 14, will correctly complete class Two?()
A.int foo() { /* more code here */ }
B.void foo() { /* more code here */ }
C.public void foo() { /* more code here */ }
D.private void foo() { /* more code here */ }
E.protected void foo() { /* more code here */ }
最新试题
Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()
Which two code fragments are most likely to cause a StackOverflowError?()
Given:Which three are true?()
DRAG DROP Click the Task button.
DRAG DROP Click the Task button.
DRAG DROP Click the Task button.
Given:Which three are valid?()
A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself.What design issue has the team discovered?()
Given:What is the result?()
Given:What is the result?()