LargestInteger.java 508B

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