alguem me ajuda pf??
tenho uma String chamada linha com este conteudo “
3
”
e estou tentando capurar so o “3”
entao pensava que dava dessa forma:
int n=Integer.parseInt(linha);
mas da o seguinte erro
Exception in thread “main” java.lang.NumberFormatException: For input string: “
3
”
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at proj_LAPR1.Main.main(Main.java:24)
Java Result: 1