Question: Which one is NOT correct about Map collection? Question 2 options: A Map is an object that maps keys to values TreeMap is faster than

Which one is NOT correct about Map collection?
Question 2 options:
A Map is an object that maps keys to values
TreeMap is faster than HashMap
In Java, the Map interface and has various implementations.
TreeMap guarantees the order of iteration
Question 3(1 point)
Saved
Which one is NOT correct about the piece of the java code:
List strList = new ArrayList();
strList.add("A");
strList.add("C");
strList.add("Z");
strList.add("E");
Collections.sort(strList);
for(String str: strList){
System.out.print(""+str);
}
Question 3 options:
The first elemet the for loop prints is "A"
ArrayList is a collection
"Collections.sort(strList);" needs to be changed to "Collection.sort(strList);"
"strList.add("E");" the element "E" is added at the end of the list.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!