I am starting to learn Java and write my first utility classes in java, which are supposed to be put into production. I am a little lost when starting to eliminate exceptions. Is there any ball-digit number about how many try arguments are in the given lines of code?
How many pieces of code should deal with exceptions .. any plugin for Eclipse?
Is it better to include 3-4 statements in a try and catch catch block, or include 10-12 lines in a try block, and then include 2-3 catch statements that catch different exceptions, for example, throw related files with either my classes or some other third-party classes ..? The first is a bit unpleasant for the eyes, and this greatly inflates the code.
Is it just common practice to just surround this code in a try block that can throw an exception or mark perfectly along the surrounding code, and also inside try say how the file descriptor is used, etc.
Any pointers ..?
source
share