Catch the specific exception in Java

class IsNullException extends RuntimeException { }
class IsEmptyException extends RuntimeException { }

static void throwWhenNullOrEmpty(int[] array)
{
    if (array == null) {
        throw new IsNullException();
    }
    if (array.length == 0) {
        throw new IsEmptyException();
    }
}

try {
    int[] array = new int[]{};
    throwWhenNullOrEmpty(array);
}
catch (IsNullException e) {
    System.out.println("array is not specified");
}
catch (IsEmptyException e) {
    System.out.println("array is empty");
}