Here is a Java program that demonstrates how to find the 2nd smallest number in an array:

**
class ArraySecondSmallest
{
public int findSecondSmallest(int[] arr, int n) {
int firstSmallest = Integer.MAX_VALUE;
int secondSmallest = Integer.MAX_VALUE;
for (int i = 0; i < n; i++) {
if (arr[i] < firstSmallest) {
secondSmallest = firstSmallest;
firstSmallest = arr[i];
} else if (arr[i] < secondSmallest && arr[i] != firstSmallest) {
secondSmallest = arr[i];
}
}
return secondSmallest;
}
}
public class Main {
public static void main(String[] args) {
ArraySecondSmallest asm=new ArraySecondSmallest();
int[] arr = {1, 14, 2, 16, 10, 20, 5};
int n = arr.length;
int secondSmallest = asm.findSecondSmallest(arr, n);
System.out.println("Second smallest element is " + secondSmallest);
}
}
**

**
In this program, The findSecondSmallest method takes two arguments; the array, and the length of the array.**

It then initializes two variables firstSmallest and secondSmallest with the maximum possible integer value (Integer.MAX_VALUE).

The method then loops through the array, comparing each element with firstSmallest. If an element is smaller than firstSmallest, the firstSmallest is updated and previous value is assigned to secondSmallest.

If an element is not smaller than the current firstSmallest but is smaller than the current secondSmallest and it's not equal to firstSmallest, it's assigned to secondSmallest.

At the end, secondSmallest will hold the 2nd smallest element of the array.

This approach is more efficient in terms of time complexity as it goes through the array once and the time complexity is O(n)

Another way to find 2nd smallest number is by sorting the array and returning the 2nd element of the array which is the 2nd smallest element or you could use the inbuilt Arrays.sort(arr) to sort the array in ascending order and get the 2nd element which is the 2nd smallest element.