java4all@1986 java. Powered by Blogger.

Get Enumeration over Java ArrayList

>> Tuesday, May 24, 2011

import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;

public class Main {
  public static void main(String[] args) {
    ArrayList<String> arrayList = new ArrayList<String>();

    arrayList.add("A");
    arrayList.add("B");
    arrayList.add("D");
    arrayList.add("E");
    arrayList.add("F");

    Enumeration e = Collections.enumeration(arrayList);

    while (e.hasMoreElements())
      System.out.println(e.nextElement());
  }
}

0 comments:

Post a Comment

FaceBook Login

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

Total Pageviews

STATCOUNTER

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP