KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am wondering how in practice other SOers tend to deal with and/or prevent exceptions. In what situations do you prevent exceptions, and how? In what situations do you catch exceptions? I usually prevent 'NullPointerExceptions' (and other similar ones) by, well, essentially saying if(foo!=null) {...} I find that in most situations this is less bulky than everything involved in using a try-catch block. I use try-catch blocks when the potential exceptions are more complex, or more numerous.
Tags (comma-separated)
Save Edits
Cancel