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

Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain

1430


What state is a thread in when it is executing?

525


What are data types in programming?

546


Write a program in java to find the maximum and minimum value node from a circular linked list.

516


List some oops concepts in java?

578






What is hotjava?

552


Compare Mutex and Semaphore in java.

556


Can an interface have a constructor?

511


What are different types of arrays?

530


What class allows you to read objects directly from a stream in java programming?

508


What is array length?

501


What is the exact difference in between Unicast and Multicast object? Where will it be used?

580


What is size_t?

501


What is annotation in java?

571


Can we overload destructor in java?

538