LargestInteger.java 525B

12345678910111213141516171819
  1. public class LargestInteger {
  2. public Integer findLargestNumberUsingConditional(Integer[] integers){
  3. int large = (integers[1] > integers[2]) ? integers[1] : integers[2];
  4. int win = (large > integers[0]) ? large : integers [0];
  5. System.out.println(win);
  6. return win;
  7. }
  8. public Integer findLargestNumberUsingMathMax(Integer[] integers){
  9. int winner = Math.max(integers[0],(Math.max(integers[1],integers[2])));
  10. System.out.print(winner);
  11. return winner;
  12. }
  13. }