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 the difference between this() and super() in java?
How do I type unicode?
What is break and continue statement?
What is jrmp?
What is jdbc api?
Is an array a vector?
os is developed in c no java is more secured then c na why dont the os developed is developed using java
What happens to the Exception object after handling an exception?
How to read and write image from a file ?
What is static data type in java?
What is the importance of main method in Java?
Can we start a thread twice in java?
What is json parser in java?
What is sortedmap in java?
What is a boolean output?