I'm working through the Head First Java book, and one piece of code it makes me write looks like this:
import java.io.*;
public class GameHelper {
public String getUserInput(String promt){
String inputLine = null;
System.out.print(promt + " ");
try {
BufferedReader is = new BufferedReader(
new InputStreamReader(System.in));
if (inputLine.length() == 0) return null;
} catch (IOException e){
System.out.println("IOException: " + e);
}
return inputLine;
}
}
But eclipse tells me the exception is never thrown from the try statement, what does that mean?