Computer Science, asked by gouripantham21, 1 month ago

Given an array, A of integers, return the second largest even element.​

Answers

Answered by tanujagautam107
0

Answer:

Explanation:

Let's see another example to get second largest number in java array using collections.

import java.util.*;

public class SecondLargestInArrayExample2{

public static int getSecondLargest(Integer[] a, int total){

List<Integer> list=Arrays.asList(a);

Collections.sort(list);

int element=list.get(total-2);

return element;

}

More items...

Similar questions