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

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -