
java-Collections(part-II)-vlits
Authored by kolla vivek
Computers
1st Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
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
25 questions
Oracle cloud 2024
Quiz
•
1st Grade
27 questions
SalesForce
Quiz
•
1st - 2nd Grade
31 questions
Unit 5 - Networks Revision
Quiz
•
1st Grade
30 questions
Computer Science
Quiz
•
1st - 5th Grade
25 questions
8下排序段考
Quiz
•
1st - 12th Grade
24 questions
10_list
Quiz
•
1st Grade
28 questions
Algorithm and flow charts
Quiz
•
KG - Professional Dev...
23 questions
Komputery
Quiz
•
KG - Professional Dev...
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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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
Discover more resources for Computers
20 questions
Telling Time to the Hour and Half hour
Quiz
•
1st Grade
10 questions
Life Cycle of a Frog
Quiz
•
1st - 2nd Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
10 questions
100th Day of School 1st/2nd
Quiz
•
1st - 2nd Grade
15 questions
Reading Comprehension
Quiz
•
1st - 5th Grade
10 questions
Identifying Physical and Chemical Changes
Interactive video
•
1st - 5th Grade
10 questions
Exploring the American Revolution
Interactive video
•
1st - 5th Grade