---
title: "What is an Iterator?"  
description: "What is an Iterator?"  
author: "Anonymous User"  
published: 2015-07-21  
updated: 2020-09-20  
canonical: https://www.mindstick.com/interview/2719/what-is-an-iterator  
category: "java"  
tags: ["java", "collection"]  
reading_time: 1 minute  

---

# What is an Iterator?

Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.

## Answers

### Answer by Anonymous User

Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.


---

Original Source: https://www.mindstick.com/interview/2719/what-is-an-iterator

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
