"N/A" is not an integer so check before parsing or handling Exceptions properly.
Exception Handling.
try{
int i = Integer.parseInt(input);
} catch(NumberFormatException ex){ // handle your exception
...
}
Integer pattern matching.
String input=...;
String pattern ="-?\\d+";
if(input.matches("-?\\d+")){ // any positive or negetive integer or not!
...
}
These are the two options you can try. It has worked for me and hope it works for you as well.
Check out Java course to learn more about it.
Thanks!