12345678910111213141516171819202122 |
- import java.util.*;
-
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
- int count = 0;
- for(Integer i : integers) {
- count = (i > count) ? i:count;
- }
- return count;
- }
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
- int count = 0;
- for(Integer i : integers) {
- count = Math.max(i, i);
- }
- return count;
- }
- }
|