The compiler is telling you that
} catch (Exception ex) {
will also catch NumberFormatException
exceptions because java.lang.NumberFormatException
extends java.lang.IllegalArgumentException
, which extends java.lang.RuntimeException
, which ultimately extends java.lang.Exception
.