Skip to Content

Public Methods can throw private Exceptions

What I didn´t know until I tried:

If you create a private exception class you can throw its objects even in a public Method:

This is quite coherent, because one can catch one of the superclasses (cx_static_check, cx_root) of the exception even if the concrete exception class is not accessible.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.