From e0ce541471a35b41e9dda3b53778e34bebe64517 Mon Sep 17 00:00:00 2001 From: Xevion Date: Wed, 29 Jan 2020 20:53:52 -0600 Subject: [PATCH] Iterator interface, basic --- study/COLLECTIONS.MD | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/study/COLLECTIONS.MD b/study/COLLECTIONS.MD index f06bbd6..761cc59 100644 --- a/study/COLLECTIONS.MD +++ b/study/COLLECTIONS.MD @@ -79,11 +79,15 @@ However, the real power comes from the next set of interfaces, and the special m ### Iterator Interface +Iterators are specialized data structures that allow traversal, data access, and data deletion (directly to the linked *original* collection). + +They are similar to Java's Enumeration interface. + ### Iterable Interface The Iterable interface is the root interface for all the collection classes. The Collection interface extends the Iterable interface and therefore all the subclasses of Collection interface also implement the Iterable interface. -It contains only one abstract method, `Iterator iterator()` which returns the `Iterator` object used to iterate over the elements of the datastructure (type `T`). +It contains only one abstract method, `Iterator iterator()` which returns the `Iterator` object used to iterate over the elements of the data structure (type `T`). ### Collection Interface