As far as I understand in java a function which throws an exception should not be compiled without a try and catch or a deceleration in the function above it. How come then this code is legitimate and dont crush?
public static void main(String[] args) {
Integer.parseInt("33");
}
even though Integer.parseInt() Throws: NumberFormatException - if the string does not contain a parsable integer.
Integer.parseInt(null);
also compiles. – CyanosisparseInt
with a try &catch. – Masson