Java Intermediate
0% completed
Previous
Next
Course
Discussions
Quiz
Question 1
What is a key feature of the List interface?
A
It allows duplicate elements.
B
It does not allow any duplicates.
C
It automatically sorts elements.
D
It does not support index-based access.
Reset Quiz
Check Answer
Question 2
Which of the following correctly creates an ArrayList of Strings?
Choose all correct options
ArrayList
list = new ArrayList
();
ArrayList list = new ArrayList
();
ArrayList
list = new ArrayList<>();
ArrayList
list = new ArrayList();
Reset Quiz
Check Answer
Question 3
Which method inserts an element into an ArrayList at a specified position?
A
add(E e)
B
put(int index, E element)
C
insert(int index, E element)
D
add(int index, E element)
Reset Quiz
Check Answer
Question 4
Which method returns an iterator for traversing the elements of a List?
A
getIterator()
B
listIterator()
C
iterator()
D
forEach()
Reset Quiz
Check Answer
.....
.....
.....
Like the course? Get enrolled and start learning!
Enroll
Previous
Next