Dear forum users! Maybe some of you have encountered a problem using the method:
Integer.parseInt(String s)
. The problem is this: the method physically on my computer doesn't want to convert some strings to numbers. We have the string "1568", the method throws an error:
Exception in thread "main" java.lang.NumberFormatException: For input string: "1568"
The last time I encountered such a problem was when solving the problem level19.lesson05.task03. I read a line from a file and split it into an array of strings using the method .split(" ")
, and then convert the strings into numbers (if this is possible, if not, I catch the exception and do nothing), the first number in the line is ignored for some reason. Has anyone encountered this, or who knows what the problem is? ps The compiler on the site skips my code!
GO TO FULL VERSION