how can u handle runtime exceptions in java plz explain
with examples briefly?
Answers were Sorted based on User's Feedback
Answer / kamal
You can catch runtime exceptions in try catch block but
generally runtime exceptions are unchecked exceptions and
are not in control of a candidate to handle
| Is This Answer Correct ? | 21 Yes | 10 No |
Answer / ravibeli
We can handle runtime exceptions also. But it cost a lot to developer, he has to pay his attention to know exactly which are the list of exceptions can come the execution block.
Example:
public class OrderNotFoundException extends RunTimeException {
pulbic OrderNotFoundException(){
super();
}
pulbic OrderNotFoundException(String msg){
super(msg);
}
}
public Order getOrderDetailById(Long id) throws OrderNotFoundException {
try {
OrderDAO orderDao = new OrderDAO();
Order order = (Order)orderDao.getOrderById(id);
} catch (){
throw new OrderNotFoundException();
}
return order;
}
| Is This Answer Correct ? | 7 Yes | 0 No |
What are the benefits if Swing over AWT?
Which method is used for setting security in applets?
What are swings awt?
Hello ..Friends. I need a Code which makes a software of Enter the cheque Details.. means any enduser enter the details in a Particular field that should be printed on the paper On Cheque. at the backend side it sholud be printed on pdf file. Thanks in Advance
What is swing in java javatpoint?
Difference between ligt weight and heavy weight?
What are the components of swing?
Name the borders provided by Swing?
What is the difference between AWT & Swing?
21 Answers BeBo Technologies, Deshaw, TCS,
Why should the implementation of any swing callback (like a listener) execute quickly?
What is swing control?
What is pane in swing?