123456789101112131415161718192021222324252627282930 |
- import java.util.*;
-
- public class LargestInteger {
-
- public Integer findLargestNumberUsingConditional(Integer[] integers){
-
- //30,20,10
-
- int maxValue = 0;
-
- //int count = 0;
-
- for (int count = 0; count < integers.length; count++){
-
- if(integers[count]>maxValue){
- maxValue = integers[count];
- }
-
- //return maxValue;
- }
-
- return maxValue;
- }
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
- return Math.max(integers[0],(Math.max(integers[1], integers[2])));
- }
-
- }
|