oop - Why the custom Exception java class should be final -


i worked ibm rational software architect websphere software(rad) , ran code analyzer. got warning said custom java exception class should final. there no proper reason that. anyhow requirments have extend custom exception classes maintain exception hierarchy. final no use. in cases if want restrict object creation can mark contructor private.

so, can body please let me know why custom exception class should final?

i refer book effective java : josh bloch says arguments mark classes final or else document extension points preserve immutability , protect unexpected behavior.

i referring item 17 (design , document inheritance or else prohibit it)

in case, might recommendation , if convinced ignore - make sure have thought it.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -