123456789101112131415161718192021222324252627 |
- import java.lang.Math;
- import java.util.Arrays;
-
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
-
- int largest = integers[0];
-
- for(int num : integers){
- largest = num;
- }
-
- return largest;
- }
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
-
- int[] tab = {};
- int largest = Arrays.stream(tab).max().getAsInt();
-
- return largest;
-
- }
- }
|