java-Collections(part-II)-vlits

java-Collections(part-II)-vlits

1st Grade

28 Qs

quiz-placeholder

Similar activities

Mid term Exam

Mid term Exam

KG - Professional Development

25 Qs

Algorithm

Algorithm

1st Grade

32 Qs

App Inventor Av.4

App Inventor Av.4

1st Grade

33 Qs

Blockchain Day1

Blockchain Day1

1st Grade

26 Qs

Java Collections

Java Collections

1st Grade

30 Qs

Criptografia - Segurança da Informação

Criptografia - Segurança da Informação

1st - 2nd Grade

25 Qs

Topic 1 Quiz

Topic 1 Quiz

1st - 9th Grade

31 Qs

Python по занятиям

Python по занятиям

1st - 10th Grade

28 Qs

java-Collections(part-II)-vlits

java-Collections(part-II)-vlits

Assessment

Quiz

Computers

1st Grade

Hard

Created by

kolla vivek

Used 4+ times

FREE Resource

28 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following are true statements?

1.The Iterator interface declares only three methods: hasNext, next and remove. 2.The ListIterator interface extends both the List and Iterator interfaces.

3.The ListIterator interface provides forward and backward iteration capabilities.

4.The ListIterator interface provides the ability to modify the List during iteration.

5.The ListIterator interface provides the ability to determine its position in the List.

2, 3, 4 and 5

1, 3, 4 and 5

3, 4 and 5

1, 2 and 3

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Which collection class allows you to associate its elements with key values, and allows you to retrieve objects in FIFO (first-in, first-out) sequence?

java.util.ArrayList

java.util.LinkedHashMap

java.util.HashMap

java.util.TreeMap

3.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will be the output of the program?

TreeSet map = new TreeSet();

map.add("one");

map.add("two");

map.add("three");

map.add("four");

map.add("one");

Iterator it = map.iterator();

while (it.hasNext() )

{

System.out.print( it.next() + " " );

}

one two three four

four three two one

four one three two

one two three four one

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which statement is true for the class java.util.ArrayList?

The elements in the collection are ordered.

The collection is guaranteed to be immutable.

The elements in the collection are guaranteed to be unique.

The elements in the collection are accessed using a unique key.

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?

java.util.SortedMap

java.util.TreeMap

java.util.TreeSet

java.util.Hashtable

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What will be the output of the program?

public static void main(String[] args)

{

Object obj = new Object()

{

public int hashCode()

{

return 42;

}

};

System.out.println(obj.hashCode());

}

42

Runtime Exception

Compile Error at line 2

Compile Error at line 5

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of these is not a interface in the Collections Framework?

Collection

Group

set

List

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?