Which is the best way of exception handling?
Answer Posted / hari
instead of using try{}catch{} blocks throw an
ApplicationException and make suclass to that class and
extend RuntimeExceptions to ApplicationException class
public void read(String name)throws ApplicationException{
badurl(name);
numberFormate(name);
}
public void badUrl(String name)throws BadUrlException{
}
public void numberFormate(String name) throws
BadNumberException{
}
ApplicationException extends RuntimeException{
}
BadUrlException extends ApplicationException{}
BadNumberException extends ApplicationException{}
| Is This Answer Correct ? | 16 Yes | 1 No |
Post New Answer View All Answers
What is flush buffer?
What is abstract class constructor called?
What 4 doubled?
What is string pool?
What is command line argument in java?
Difference between a class and an object?
Is java 1.7 the same as java 7?
What is the meaning of find and replace?
What is queue in java?
Difference between concurrent hashmap and hashtable and collections
Explain wait(), notify() and notifyall() methods of object class ?
What method is used to specify a container's layout in java programming?
What is type safety in java?
why using interface interface ?
What is constructor and its types?