-3

Zybooks keeps throwing this error:

Exception in thread "main" java.lang.NumberFormatException: For input string: "JaneAusten" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615)

I have posted a picture of my code, thanks.

image 1

image 2

image 3

Chase
  • 93
  • 1
  • 1
  • 7
  • 1
    Why a picture of your code? I might want to test it, and then I have to transcribe your code, while you could make my life a lot easier and just post the code here. What do you think I'm going to do? Ignore your question or transcribe the code and try to help you? – Johannes Kuhn Mar 28 '18 at 04:34
  • @John3136 Definitely a 9 – Scary Wombat Mar 28 '18 at 04:36
  • 1
    Please [don't post image of code](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors) and [format code and error messages as code](https://meta.stackoverflow.com/questions/251361/how-do-i-format-my-code-blocks) and create a [mcve]. 3 images is definitely not a MCVE. – user202729 Mar 28 '18 at 04:37
  • Make sure `dataString` **does in fact contain a valid string representation of a numerical value** and NOT a null string ("") or NOT a value that contains any characters other than digits 0 to 9. The **Integer.parseInt()** method must contain a string numerical value. – DevilsHnd - 退職した Mar 28 '18 at 04:44

1 Answers1

0

provide the clear stack trace ,the first line is truncated..

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

Reason for exception is You are trying to convert a string "JaneAusten" to interger by API "Integer.parseInt".

Rajesh Gopu
  • 863
  • 9
  • 33