Search Header Logo

Java-Collections

Authored by Subba Chavva

Computers

University

Used 3+ times

Java-Collections
AI

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

20 sec • 1 pt

Which of the following is a part of the Java Collections Framework?

ArrayList

Array

int[]

String

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which collection does not allow duplicate elements?

List

Set

Map

All of the above

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which collection class is synchronized?

HashSet

TreeSet

Hashtable

HashMap

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of these is not a method in the Collection interface?

add()

get()

remove()

size()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

ArrayList<String> list = new ArrayList<>();

list.add("Java");

list.add("Python");

System.out.println(list.remove(0));

Java

Python

true

Compilation error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is incorrect statement about the Hastable class?

Hashtable class implements Map interface.

Hashtable class extends the Dictionary class.

Hashtable class implements Cloneable interface.

Hashtable class extends Properties class.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one is the correct way to iterate over elements in an ArrayList?

for (int i = 0; i < list.size(); i++)

for (int i : list)

for (Object obj : list)

for (Iterator it = list.iterator(); it.hasNext();)

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?

Discover more resources for Computers