12345678910111213141516171819 |
-
-
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
- int large = (integers[1] > integers[2]) ? integers[1] : integers[2];
- int win = (large > integers[0]) ? large : integers [0];
- System.out.println(win);
- return win;
- }
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
- int winner = Math.max(integers[0],(Math.max(integers[1],integers[2])));
- System.out.print(winner);
- return winner;
- }
- }
|