write a java program to find first and second maximum element in array
Answers
Answered by
17
Answer:
Let's see another example to get second largest element or number in java array using collections.
import java.util.Arrays;public class SecondLargestInArrayExample1{public static int getSecondLargest(int[] a, int total){Arrays.sort(a);return a[total-2];
Answered by
0
Answer:
Let's see another example to get second largest element or number in java array using collections.
import java.util.Arrays;
public class SecondLargestInArrayExample1{
public static int getSecondLargest(int[] a, int total){
Arrays.sort(a);
return a[total-2];
}
public static void main(String args[]){
MAKE MD BRAINLIEST
Similar questions
Math,
2 months ago
Political Science,
2 months ago
Science,
4 months ago
Math,
10 months ago
Math,
10 months ago