KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > Iterable


1 /*
2  * @(#)Iterable.java 1.3 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.lang;
9
10 import java.util.Iterator JavaDoc;
11
12 /** Implementing this interface allows an object to be the target of
13  * the "foreach" statement.
14  */

15 public interface Iterable<T> {
16
17     /**
18      * Returns an iterator over a set of elements of type T.
19      *
20      * @return an Iterator.
21      */

22     Iterator JavaDoc<T> iterator();
23 }
24
Popular Tags