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