How to convert Unchecked Exception into Checked Exception and Vice Versa in Java -
In Java, convert uncheck exception to checked exceptions How to do and Vice President in Java You can not change. Instead you have to wrap a new exception of the required type to uncheck to convert: Or to check: (You can choose more meaningful / specific exception types)
throw the new runtime exception (check Exception);
throw a new exception (uncheck exception);
Comments
Post a Comment