123456789101112131415161718192021222324 |
- import java.lang.*;
-
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
- Integer largest = 0;
- for (int i=0;i<integers.length;i++){
- if (integers[i]>largest)
- largest = integers[i];
- }
- return largest;
- }
-
-
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
- int x = 300;
- int y = 200;
- int z = 600;
- return Math.max(Math.max(x,y),z) ;
- }
-
- }
|