how to make a un-checked exception as a checked exception one.

Answer Posted / suvarna

Wrapping Checked Exceptions in Unchecked Exceptions
try {
// ... some code that could throw IOException or
RemoteException
} catch(Exception ex) {
throw new RuntimeException(ex.toString());
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to create constants in java?

607


Explain java code for recursive solution's base case?

574


What is the difference between call by reference and call by pointer?

501


How to sort elements in a parallel array in java?

508


please send me hr interview questions in it industry

1670






What is the use of list in java?

524


What is output buffer?

570


Explain the difference between map and flatmap stream operation?

821


Can we split string with in java?

534


What one should take care of, while serializing the object?

484


Do you know why doesn't the java library use a randomized version of quicksort?

554


What is super?

585


Can a class have an interface?

554


What are the different http methods?

533


What is fail fast in java?

576