Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java max array

public static String max(String[] arr) {
  String result = arr[0];
  for (int i = 1; i < arr.length; ++i) {
    if (result.compareTo(arr[i]) < 0) result = arr[i];
  }
  return result;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #max #array
ADD COMMENT
Topic
Name
4+7 =