123456789101112131415161718192021222324 |
-
-
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
- int count = 0;
- int max = 0;
- for(count = 0; count <integers.length; count++){
- if(integers[count] > max){
- max = integers[count];
- }
- }
- return max;
- }
-
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
-
- return Math.max(integers[0],Math.max(integers[1],integers[2]));
-
- }
- }
|