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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -