Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to find Minimum item of ArrayList

Java: How to find Minimum item of ArrayList
{filelink=4858}

import java.util.ArrayList;
import java.util.Collections;
public class ArrayL_Min
 {
  public static void main(String[] args)
  	{
    ArrayList array_L = new ArrayList();
    array_L.add(5);
    array_L.add(9);
    array_L.add(-85);
    array_L.add(4);
   // Return the minumum element of ArrayList
    Object obj = Collections.min(array_L);
    System.out.println(obj);
  }
}

No comments yet.

Leave a Comment