Computer Science, asked by sreeraj930, 1 year ago

Write a java program to find second smallest element in an array.

Answers

Answered by Oreki
0

// A method to get the second smallest element in the passed int Array.

static int secondSmallest(int[ ] array) {

int[ ] temp = array;

java.util.Arrays.sort(temp);

return temp[1];

}

Similar questions