Issue
trying to get outputs depending on what java.lang.NumberFormatException e is after the try{}.
String o = "";
try {
//Does something with o
}catch(java.lang.NumberFormatException e) {
if(e != null) {//<-
console.log("Incorrect input at: " + o);
}else if(e == null){//<-
System.out.println("Working fine!");
}
}
I'm looking to find what to use instead of null in the catch if statement
Solution
It should look something like this:
String o = "";
try{
//Does something with o
System.out.println("Working fine!");
}
catch(java.lang.NumberFormatException e)
{
console.log("Incorrect input at: " + o);
}
Answered By - Clifford Cheefoon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.