Monday, January 19, 2015

Collection Shuffle in java pgm



Collection Shuffle

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Main
{
 public static void main(String[] argv) throws Exception
  {
      String[] alpha = { "A", "E", "I", "O", "U" };
      List list = new ArrayList(alpha);
      Collections.shuffle(list);
      System.out.println("list");
   }  
}

No comments:

Post a Comment