I've been trying to get an integer from a scanned
string and can't seem to get it to work. Here's my code:
The idea is to enter an item @ quantity e.g "Shirt @ 2" and put shirt into one ArrayList and qty into another.
qty holds Integers.
Here's the exception I get, it's thrown at the last line of shown code:
Exception in
thread "main" java.lang.NumberFormatException: For input string: "shirt "
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
Thanks in advance.