Originally Posted by
thenava
or just add
throws IOException
underneath your main method declaration.
...
public static void main(String args[])
throws IOException {
String name;
...
that should work.
No, main really should not throw exceptions. How do you intend to handle an exception that is thrown beyond the scope of your execution?
The catch block should be placed within main() and handle the exception gracefully.