@SuppressWarnings({"unchecked","rawtypes"}) public static Comparable<?> max(Comparable<?>[] ar){
  Comparable ret=ar[0];
  for (int i=1; i < ar.length; i++) {
    if (ret.compareTo(ar[i]) < 0) {
      ret=ar[i];
    }
  }
  return ret;
}

@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static Comparable < ? > max ( Comparable < ? > [ ] ar ) { Comparable ret = ar [ 0 ] ; for ( int i = 1 ; i < ar . length ; i ++ ) { if ( ret . compareTo ( ar [ i ] ) < 0 ) { ret = ar [ i ] ; } } return ret ; }
locate the maximum value from an array of comparables .
