how can u handle runtime exceptions in java plz explain
with examples briefly?

Answers were Sorted based on User's Feedback



how can u handle runtime exceptions in java plz explain with examples briefly?..

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

how can u handle runtime exceptions in java plz explain with examples briefly?..

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

how can u handle runtime exceptions in java plz explain with examples briefly?..

Answer / manish

You can catch compile time Exception,with using try and
catch or throws keyword,Buti think if u r going to catch
Runtime Exception then no,meaning bcoz Runtime Exception are
unchecked
exception.Means no meaning of try and catch but u can use.

Is This Answer Correct ?    15 Yes 9 No

Post New Answer

More Swing Interview Questions

What is pane in swing?

0 Answers  


What is double buffering ?

0 Answers  


How is parsing html used in swing?

0 Answers  


What is jfc? What are the features of jfc?

0 Answers  


Why are swing components called lightweight components?

0 Answers  






What are tab pans?

3 Answers  


What are swing controls?

0 Answers  


can we create a object in static block class A { static { A a=new A(); } }

7 Answers   Cap Gemini,


I want to change the appearance of Frame in Runtime, what class can be used to do this?

2 Answers   TCS, Wipro,


What are the features of JFC?

1 Answers  


Explain the difference between swing and jsf.

0 Answers  


What is sling swing?

0 Answers  


Categories