Javatpoint Logo
Javatpoint Logo

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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback

  • Send your Feedback to feedback@javatpoint.com

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA