NumberFormatException when parsing String to Float value [duplicate]
问题 This question already has answers here : How to do an Integer.parseInt() for a decimal number? (9 answers) Closed last year . System.out.println("Enter a number: "); String in1 = input.nextLine(); Integer input1 = Integer.valueOf(in1); Float input2 = Float.parseFloat(in1); Double input3 = Double.valueOf(in1).doubleValue(); System.out.println(); System.out.println("Enter another number: "); String in2 = input.nextLine(); Integer input21 = Integer.valueOf(in2); Float input22 = Float.parseFloat