Integer.parseInt(str) throws NumberFormatException
if the string does not contain a parsable integer. You can hadle the same as below.
int a;
String str = "N/A";
try {
a = Integer.parseInt(str);
} catch (NumberFormatException nfe) {
// Handle the condition when str is not a number.
}