12. Collections and Generics.pdf

12. Collections and Generics.pdf - DURGA’s SCJP Material...

This preview shows page 1 - 5 out of 27 pages.

DURGA’s SCJP Material DURGASOFT, # 202,2 nd Floor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038, 040 – 64 51 27 86, 80 96 96 96 96, 9246212143 | Page 1
Image of page 1

Subscribe to view the full document.

DURGA’s SCJP Material DURGASOFT, # 202,2 nd Floor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038, 040 – 64 51 27 86, 80 96 96 96 96, 9246212143 | Page 2 12. Collections and Generics Q: 01 Given: 34. HashMap props = new HashMap(); 35. props.put("key45", "some value"); 36. props.put("key12", "some other value"); 37. props.put("key39", "yet another value"); 38. Set s = props.keySet(); 39. // insert code here What, inserted at line 39, will sort the keys in the props HashMap? A. Arrays.sort(s); B. s = new TreeSet(s); C. Collections.sort(s); D. s = new SortedSet(s); Answer: B Q: 02 Click the Exhibit button. Which statement is true about the set variable on line 12?
Image of page 2