Java Vector iterator() Method

The iterator() method of Java Vector class is used to get an iterator over the elements in this list in proper sequence.

Syntax

Following is the declaration of an iterator() method:

Parameter

This method does not accept any parameter.

Return

The iterator() method returns an iterator over the elements in this list in proper sequence.

Exceptions

NA

Compatibility Version

Java 1.2 and above

Example 1

Test it Now

Output:

Red
Green
Blue
Pink

Example 2

Test it Now

Output:

100
200
300
400

Next TopicJava Vector




Latest Courses