P
Q. What will be the output of the following code
import java.util.Comparator; import java.util.Map; import java.util.TreeMap; public class SortMap { public static void main(String…a) { Map<Integer,Integer> treeMap = new TreeMap<Integer,Integer>(new Comparator<Integer>() { public int compare(Integer o1,Integer o2) { return o2.compareTo(o1); } }); treeMap.put(4,1); treeMap.put(2,1); treeMap.put(3,1);{ System.out.println(treeMap); } } }
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
Q. Which is the alternative to SWITCH in Java language?
Q. What is garbage collection in the context of Java?
Q. Which of those permits the storage of the many null values?
Q. What is the output of the below Java program with a void method?
Q. What will be the output of the following code
Q. Which of these is superclass of ContainerEvent class?
Q. hich package is used for Remote Method Invocation (RMI)?
Q. The delimiter used to separate command-line arguments in Java is ____.
Discusssion
Login to discuss.