Write a class “Program1” that has the method “allLess” (below) that receives two arrays of integers and
returns true if each element in the first array is less than the element at the same index in the second
array. For example, given the arrays {42, 2, 30} and {50, 6, 44}, the method returns true. In cases where
arrays don’t have the same length, the method will compare up to the length of the shortest array.
public static boolean allLess(int[] one, int[] two)
1 answer
Since all you are passing is the address of the arrays, there's no way to determine their length, unless there's some kind of sentinel value to signal the end of the array.