-2

Like the title how it can accepts an array of int and returns the largest value from the array

1 Answers1

0

You could do something like:

Integer array[] = {1, 4, 3, 2};
int max = Collections.max(Arrays.asList(array));
System.out.println(max);
Output:
4
SMA
  • 36,381
  • 8
  • 49
  • 73