Java Collection maps

Java Collection maps

University

24 Qs

quiz-placeholder

Similar activities

GIS UNIT-3 Quiz

GIS UNIT-3 Quiz

University

20 Qs

IGH Test de Entrada

IGH Test de Entrada

University

20 Qs

PPS PYTHON QUIZ

PPS PYTHON QUIZ

University

20 Qs

Primer parcial

Primer parcial

University

20 Qs

AI BootCamp: 2024 Edition- Session 1

AI BootCamp: 2024 Edition- Session 1

University

20 Qs

Assignment for MSE+CIE-2

Assignment for MSE+CIE-2

University

20 Qs

Python Recap

Python Recap

7th Grade - University

20 Qs

Atividade de Fixação - Python

Atividade de Fixação - Python

University

20 Qs

Java Collection maps

Java Collection maps

Assessment

Quiz

Computers

University

Hard

Created by

A Vijay Kumar

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?