123456789101112131415161718 |
- import java.util.*;
-
- public class LargestInteger {
- public Integer findLargestNumberUsingConditional(Integer[] integers){
- int highestNum = integers[0];
- for (int i = 0; i < integers.length; i++){
- if (i > highestNum){
- highestNum = integers[i];
- }
- }
- return highestNum;
- }
-
- public Integer findLargestNumberUsingMathMax(Integer[] integers){
- return Math.max(integers[0],(Math.max(integers[1],integers[2])));
- }
- }
|