This is my own practice code.
But i could not understand why i get this output.Why there is NumberFormatException in line1
output:
Enter age
23
23
Exception in
thread "main" java.lang.NumberFormatException: For input
string: "2
"
at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
at java.lang.Integer.parseInt(Integer.java:456)
at java.lang.Integer.parseInt(Integer.java:497)
at exc.Test.main(Test.java:28)