java - Exceptions as public classes vs. public static inner classes -
i have 2 options (which technically same, understand) declare custom exception class thrown particular class com.xxx.foo
:
- as public class in package:
com.xxx.customexception
- as public static inner class:
com.xxx.foo.customexception
which option better?
in case exception specific foo
class, don't mind keeping public
nested class. , whenever seems time extract out, extract out.
in general practice, have never seen nested class defined exception, though. don't know if 1 exist in java api.
Comments
Post a Comment