Like the title how it can accepts an array of int and returns the largest value from the array
Asked
Active
Viewed 35 times
1 Answers
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