123456789101112131415161718 |
-
-
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
-
- int first = (integers[0] > integers[1]) ? integers[0] : integers[1];
- int second = (first > integers[2]) ? first : integers[2];
-
- return second;
- }
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
- return Math.max(integers[0], Math.max(integers[1],integers[2]));
- }
- }
|