123456789101112131415161718192021 |
-
-
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
- int i;
- int max = integers[0];
- for(i = 0; i < integers.length; i++){
- if (integers[i] > max){
- max = integers[i];
- }
- }
- return max;
- }
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
- return Math.max(integers[0],Math.max(integers[1],integers[2]));
- }
- }
|