179. What is the result?
A. 2
B. 3
C. 4
D. 16
E. Compilation fails.
180. 5. Given:
What is the result?
A. 3.14 50 100
B. 100 50 3.14
C. Compilation fails.
D. An exception is thrown at line 4.
E. An exception is thrown at line 5.
F. An exception is thrown at line 7.
181.
182.
Place the correct Animals to the Outputs empty boxes.
(Animals can be used more than once . )
183. 7. Which two, inserted at line 1, will compile? (Choos two.)
A.
B.
C.
D.
E.
F.
class MaxValue<X> {
class MaxValue<X extends Object> {
class MaxValue<X extends Number> {
class MaxValue<X extends Integer> {
class MaxValue<?> {
class MaxValue<? extends Number> {
184.
185. 8. The following class is designed for the key value of
java.util.HashMap.
Which two method should be overridden to make the
MyKey work correctly? (Choose two.)
A. public String toString()
B. public boolean equals(MyKey k)
C. public int compareTo(MyKey k)
D. public int hashCode()
E. public boolean equals(Object k)
186.
187. 9. Given:
Which code, inser ted a t line 4, will guarantee to output [4, 5]?
A. Set x = new HashSet();
B. Set x = new SortedSet();
C. Set x = new TreeSet();
D. List x = new ArrayList();
E. List x = new LinkedList();