|
@@ -4,10 +4,12 @@
|
4
|
4
|
public class LargestInteger {
|
5
|
5
|
|
6
|
6
|
public Integer findLargestNumberUsingConditional(Integer[] integers){
|
7
|
|
- return null;
|
|
7
|
+ return integers[0] > integers[1] && integers[0] > integers[2] ? integers[0]
|
|
8
|
+ : integers[1] > integers[0] && integers[1] > integers[2] ? integers[1]
|
|
9
|
+ : integers[2];
|
8
|
10
|
}
|
9
|
11
|
|
10
|
12
|
public Integer findLargestNumberUsingMathMax(Integer[] integers){
|
11
|
|
- return null;
|
|
13
|
+ return Math.max(integers[0], Math.max(integers[1], integers[2]));
|
12
|
14
|
}
|
13
|
15
|
}
|