Share via


MapIterator.new Method

Creates a new iterator for a map that allows you to traverse through the elements in the map.

Syntax

public void new(Map map)

Run On

Called

Parameters

  • map
    Type: Map Class
    The map for which you want to create an iterator.

Remarks

The iterator is positioned at the first value in the map, if the map is not empty.

Examples

The following example creates a map of integer, class pairs and then creates an iterator to traverse the map.

Map iim = new Map(Types::Integer, Types::Class); 
MapIterator it; 
  
it = new MapIterator (iim);

See Also

Reference

MapIterator Class