Q1.
you have a hashmap whose keys need to to be retrieved in a sorted manner.Which of the following would help you achieve this?
Select any 2 options
a.copy contents of hashmap to treemap
b.add keys of hashmap to treeset
c.pass the hashmap to Arrays.sort method
d.pass the hashmap to Collections.sort method
i think
answer should be a and b
please,tell if i am wrong and do give the right answer with reason
Q2.
What's the output of the following if assertions are enabled ??(Choose ONe)
a.compiles and run
b.compiles an throws AssertionError with message
ut of range
c.compilation error at line 7
d.compilation error at line 14
i think
answer should be b
please,tell if i am wrong and do give the right answer with reason