I am beginning to learn Java and writing my first utility classes in java which are supposed to go in production. I am somewhat lost when it is coming to dealing with exceptions. Is there some ballpark figure on how many try statements are there in a given lines of code?
How much fraction of code is supposed to deal with exceptions..any plugin for Eclipse?
Is it best practice to include 3-4 statements in a try block and catch exception or include 10-12 lines in a try block and afterwards include 2-3 catch statements catching different kind of exceptions say ones throws by File related or by my own classes or some other 3rd party classes..? The former is a bit displeasing to eyes and it is bloating code so much..
Is this common practice to only and only surround that code in try block which can throw exception or it's fine to tag along surrounding code as well inside try say how the file handle is being used etc..
Any pointers..?