Iterator interface is expected to supplant the Enumeration interface : Iterator « Utility Classes « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Utility Classes » Iterator 
8.27.1.Iterator interface is expected to supplant the Enumeration interface
import java.util.Iterator;
import java.util.Vector;

public class MainClass{
    public static void main(String[] argv){
         Vector v = new Vector();
         v.add("a");
         v.add("b");
         v.add("c");
         Iterator isL = v.iterator();
         while isL.hasNext() ) {
            System.out.printlnisL.next() ) ;
         }   
    }
}
8.27.Iterator
8.27.1.Iterator interface is expected to supplant the Enumeration interface
8.27.2.The Iterator Interface replaces the Enumeration interface.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.