The
Iterator helps you to move through all the elements in a collection.
The methods used by
Iterator are:
Iterator itr = num.iterator(); The following example illustrates all the methods of Iterator :
IteratorDemo CODE import java.util.*; OUTPUT 10 20 30 40 50 DESCRIPTION This example explains all the 3 methods of THINGS TO TRY
Dependent Topics :
|