Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 3
    empty catch is very very very bad Commented Jun 19, 2013 at 14:51
  • 2
    @OliverWatkins answer updated to show how to handle an exception. Commented Jun 19, 2013 at 14:53
  • In general when I have determined that an exception is (as far as I know) not going to happen I rethrow a RuntimeException, so if the Exception really does happen at least the application falls over with a decent exception rather than doing something "suprising". (NB; i'm not the downvoter either) Commented Jun 19, 2013 at 14:54
  • I get 9 errors with this all class, interface, or enum expected I'll work on getting this error fixed, thanks for the help, much appreciated. Commented Jun 19, 2013 at 14:54
  • @LuiggiMendoza in.close() requires also a try/catch. Commented Jun 19, 2013 at 14:57