Computer Science, asked by veekahith30, 4 months ago

write a java program to find first and second maximum element in array ​

Answers

Answered by Anonymous
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 sajinkya674
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