Question
import java.util.*;
class Maps
{
public static void main(String args[])
{
TreeMap obj = new TreeMap();
obj.put("A", new Integer(1));
obj.put("B", new Integer(2));
obj.put("C", new Integer(3));
System.out.println(obj.entrySet());
}
}
a.
[A, B, C].
b.
[1, 2, 3].
c.
{A=1, B=2, C=3}
d.
[A=1, B=2, C=3].
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. Which of these is true about unmodifiableCollection() method?
View solution
Q. Which of these methods can convert an object into a List?
View solution
Q. Which of these methods can randomize all elements in a list?
View solution
Q. Which of these methods sets every element of a List to a specified object?
View solution
Q. Which of these is an incorrect form of using method max() to obtain a maximum element?
View solution
Q. What is Collection in Java?
View solution
Q. Which of these methods deletes all the elements from invoking collection?
View solution
Q. Which of this interface is not a part of Java’s collection framework?
View solution
Q. Which of these classes is not part of Java’s collection framework?
View solution
Q. Which of these packages contain all the collection classes?
View solution
Q. Which of these package provides the ability to read and write in Zip format?
View solution
Q. Which of these interfaces is implemented by TimerTask class?
View solution
Q. Which of these classes can schedule task for execution in future?
View solution
Q. Which of these methods is called when observed object has changed?
View solution
Q. Which of these methods calls update() method?
View solution
Q. Which of these methods is used to notify observer the change in observed object?
View solution
Q. What is the use of Observable class?
View solution
Q. Which of these is a method can generate a boolean output?
View solution
Q. Which of these method of Locale class can be used to obtain country of operation?
View solution
Q. Which of these class can generate pseudorandom numbers?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!