July 2018
Intermediate to advanced
242 pages
8h 6m
English
Let's consider the following Java code:
int value;try { result = parseInt(input);} catch (NumberFormatException e) {} finally { result = 0;}
It declares an int result variable. Next, it tries to parse the string value to the integer with the Integer.parseInt() function, and if it succeeds, it assigns the result to the value variable. If the parseInt() fails to parse the string, a default value of 0 is assigned to the value variable.
Read now
Unlock full access