Find Minimum element of Vector - Java Collection Framework

Java examples for Collection Framework:Vector

Description

Find Minimum element of Vector

Demo Code

 
import java.util.Vector;
import java.util.Collections;
 
public class Main {
 
  public static void main(String[] args) {
   /*w w  w .ja va2 s  .c o m*/
    Vector v = new Vector();
   
    v.add(new Double("4.14"));
    v.add(new Double("5.13"));
    v.add(new Double("2.12"));
    v.add(new Double("7.19"));
    v.add(new Double("3.15"));
   
    Object obj = Collections.min(v);
   
    System.out.println("Minimum Element of Java Vector is : " + obj);
  }
}

Result


Related Tutorials