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

Answers were Sorted based on User's Feedback



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

Answer / janardhan

If a client can reasonably be expected to recover from an
exception, make it a checked exception. If a client cannot
do anything to recover from the exception, make it an
unchecked exception.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / 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

More Core Java Interview Questions

What is identifier with example?

0 Answers  


What is nan in java?

0 Answers  


What is the difference between Stream Reader and Stream Writer?

4 Answers  


What are exceptions

0 Answers   Futures First,


what is the swingutilities.invokelater(runnable) method for? : Java thread

0 Answers  






In case of inheritance what is the execution order of constructor and destructor?

0 Answers   Agilent,


What things should be kept in mind while creating your own exceptions in java?

0 Answers  


Justify your answer that you can't define a method inside another method in java, if you can then how?

0 Answers  


What is the generic class?

0 Answers  


What is a Null object?

1 Answers   Wipro,


what is the purpose of the final in the try-catch-final

7 Answers  


What is stack class in java?

0 Answers  


Categories