what is the Error You are getting .if You are getting a Number Format Exception .That is because the application has attempted to convert a character or a string to one of the numeric types, but that the string does not have the appropriate format.So you cannot enter a String or Character .
if You are getting this Error Value out of range You better check out the ParseByte .You can check the ParseFloat and ParseDouble to accomadate higher range .
Joined: Aug 17, 2005
The error I get is Exception in thread "main" java.langNumberFormatException: empty String
at java.lang.FloatingDecimal.readJavaFormatString<FloatingDecimal.java:983> at java.lang.Float.parseFloat<float.java:222> at Fahrenheit.main<Fahrenheit.java:14>
Sorry about the fonts... I don't know how to quote code in the body of the message yet... In any event the system hangs on reaching lines 17 and 18 in your original code below (commented below); these lines appear to be un-necessary. Commenting these lines out yields runnable code; though input values are limited to a range of -128 to 127 (Byte value range).
One thought... Why re-declare br with every iteration of your loop? the code runs with "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));" placed before the loop.