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