Ad
Code
Diff
  • import java.util.Arrays;
    import java.util.Collections;
    
    public class Kata {
        public static int findMax(int[] my_array) {
            // Write a method that returns the largest integer in the list.
            // You can assume that the list has at least one element.
            Arrays.sort(my_array);
            return my_array[my_array.length-1];
        }
    }
    • import java.util.Arrays;
    • import java.util.Collections;
    • public class Kata {
    • public static int findMax(int[] my_array) {
    • // Write a method that returns the largest integer in the list.
    • // You can assume that the list has at least one element.
    • return 7;
    • Arrays.sort(my_array);
    • return my_array[my_array.length-1];
    • }
    • }