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:

  throw the new runtime exception (check Exception);   

Or to check:

  throw a new exception (uncheck exception);   

(You can choose more meaningful / specific exception types)

Comments

Popular posts from this blog

php - how to change mysql_result($res, 0, "url"); to mysqli -

Delphi: missing interface declarations for UI Automation methods -

android - How to attach an image from an app to gmail -