
Java Collection maps
Quiz
•
Computers
•
University
•
Hard
A Vijay Kumar
Used 1+ times
FREE Resource
Enhance your content in a minute
24 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is faster and uses less memory?
ListEnumeration
Iterator
Enumeration
ListIterator
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which interface does java.util.Hashtable implement?
Java.util.Map
Java.util.List
Java.util.HashTable
Java.util.Collection
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output
public class TreeMapTest {
public static void main(String args[]) {
Map<Integer, String> m = new TreeMap<Integer, String>();
m.put(11, "audi");
m.put(null, null);
m.put(11, "bmw");
m.put(null, "ferrari");
System.out.println(m.size());
System.out.println(m);
}
Nullpointer exception
compiler error
2
Null value
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class MyClass {
public static void main(String args[]) {
Map<String, String> hashMap = new HashMap<String, String>();
hashMap.put(new String("a"), "audi");
hashMap.put(new String("a"), "ferrari");
System.out.println(hashMap);
}
}
a=audi
a=audi
a=ferrari
a=ferrari
Run time Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is synchronized?
TreeMap
HashMap
Hashtable
All of the above
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you sort given HashMap on basis of values
Implement Comparator interface and override its compare method
It is not possible
Implement Comparator interface and override its compareTo method
Implement Comparator interface and override its comparable method
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statement is not True about Generics in java?
Generics are features of the Java programming language that allow programmers to write parameterized code.
With generics, the compiler can not detect violations at compile time, thus eliminating potential bugs.
Due to the demand of safer code, generics were added to the Java programming language.
generics allow you to write generic code
Stronger type checks at compile time
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 Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
SOFTWARE 7I
Quiz
•
7th Grade - University
20 questions
UAS Struktur Data 2022
Quiz
•
University
19 questions
программирование
Quiz
•
9th Grade - University
20 questions
ROUND 1
Quiz
•
University
20 questions
Python Unit 1 Quiz
Quiz
•
University
20 questions
Quiz on Java
Quiz
•
University
20 questions
WebFundamentals
Quiz
•
University
20 questions
Ch.8 - Introducing Python
Quiz
•
6th Grade - Professio...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
