
Java Collections
Authored by A Vijay Kumar
Computers
University
Used 18+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
-Contains no duplicate elements.
-Can contain at most one Null value.
-Elements are not key-value pairs.
-Accessing an element can be almost as fast as performing a similar operation on an array.
Which of these classes provides the specified features?
LinkedList
TreeMap
HashSet
LinkedHashMap
HashMap
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statement about Set is true?
A HashSet cannot have a null value.
Set allows duplicate values.
Set allows null values but only single occurrence.
Set extends the Java.util.collection interface.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
-Entries are not organized as key/value pairs.
-Duplicate entries are rejected.
Which interface of the java.util package offers the specified behavior?
List
Map
Set
None of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
List listNames = new ArrayList();
listNames.add("Tom");
listNames.add("Mary");
listNames.add("Peter");
String name2 = (String) listNames.get(1);
System.out.println(name2);
What is the output of the above code
Tom
Mary
Peter
raises Exception
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is Collection in Java?
A group of objects
A group of classes
A group of interfaces
None of the mentioned
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these interface is not part of Java’s collection framework?
List
Sorted List
Set
Sorted Map
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these interface declares core method that all collections will have?
Collection
EventListner
Comparator
Set
List
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
Already have an account?