Question: Langauge java, having trouble handling this exception below Exception in thread main java.lang.NumberFormatException: For input string: at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.base/java.lang.Integer.parseInt(Integer.java:662) at java.base/java.lang.Integer.parseInt(Integer.java:770) at a5.Assign5Main.main(Assign5Main.java:24)

Langauge java, having trouble handling this exception below

Exception in thread "main" java.lang.NumberFormatException: For input string: ""

at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

at java.base/java.lang.Integer.parseInt(Integer.java:662)

at java.base/java.lang.Integer.parseInt(Integer.java:770)

at a5.Assign5Main.main(Assign5Main.java:24)

Code: public static void main(String[] args) throws IOException { JOptionPane.showMessageDialog(null, welcomeMessage); Thesaurus mythesaurus = new Thesaurus();
int userSelection = 0; while (userSelection != QUIT) {  //line24  userSelection = Integer.parseInt(JOptionPane.showInputDialog(promptMessage)); processSelection(mythesaurus, userSelection); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!