In Java, usually an Error like AssertionError is used for those cases.
By example, for a switch on an enum, the compiler inserts a "throw new ...Error()" automatically when the default case is not specified.
By example, for a switch on an enum, the compiler inserts a "throw new ...Error()" automatically when the default case is not specified.
No comments yet.