0
Why is output Parsing Error?
2 Réponses
+ 1
My reason is because of the parsing Integer.parseInt(s);
The 5.6 itself is a decimal value so we can't convert it to integer, instead we have to use double/float right?
So because of that error it creates an exception which is handled by the catch and so it outputs Parsing Error
Hence the other codes will be skipped
Need some clarification if this is correct haha
+ 4
Dell's answer is right. You parsed the string incorrectly. You should use Double.parseDouble(s);