|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#24. Given: 3. public int compareTo (Object o ) { 4. return 0; 5. } }
and 20. Drink one = new Drink(); 21. Drink two = new Drink(); 22. one.name = “Coffee”; 23. two .name = “Tea”; 25. set.add(one); 26. set.add(two);
A programmer iterates over the TreeSet and prints the name or each Drink object. What is the result?
Show comments for this question (0)
Add comments
Link to this question
|
|
#29. Given: 10. interface Foo {} 11. class Alpha implements Foo {} 12. class Beta extends Alpha {} 13. class Delta extends Beta { 14. public static void main ( String[] args ) { 15. Beta x = new Beta(); 16. // insert code here 17. } 18. }
Which code, inserted at line 16, will cause ajava.lang.ClassCastException?
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.269
|
Server date 06:24 10-01-2009
|
Developed by Zip © 2006
|
|
 |
|
|