FUNDAMENTALS OF COMPUTER

DATABASE FUNDAMENTALS

BASICS OF BIG DATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Can elements of a Set be traversed without using Iterator?
A
YES
B
NO
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -Using ListIterator which extends Iterator, can traverse in both directions. Both read and remove operations can be performed by the iterator interface.

Detailed explanation-2: -There are three common ways to iterate through a Collection in Java using either while(), for() or for-each().

Detailed explanation-3: -6) What is the difference between Iterator and ListIterator? Iterator traverses the elements in the forward direction only whereas ListIterator traverses the elements into forward and backward direction.

Detailed explanation-4: -SortedSet. A sorted set is a set that further guarantees that its iterator will traverse the set in ascending element order, sorted according to the natural ordering of its elements, or by a comparator provided at sorted set creation time.

There is 1 question to complete.