Multiple choice

Find out the true statements.

i. Iterator is used to obtain and remove the elements from the collection. ii. Iterator is used to obtain and modify the elements in the collection. iii. List Iterator is used to obtain and remove the elements from the collection. iv. List Iterator is used to obtain and modify the elements in the collection.

  1. i. and iii. are true.

  2. i. and iv. are true

  3. ii. and iii. are true.

  4. ii. and iv. are true.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This answer is correct. Iterator is used to obtain the elements from the collection in forward direction only. Also, it has the capability to remove the elements from the collection. List Iterator is used to obtain the elements from the collection in forward direction only. Also, it has the capability to modify the elements in the collection.