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 do you mean by pointer value and address?
Explain about static imports in java?
How does compareto work in java?
What is return type in java?
What is parsing and its types?
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea
How variables are declared?
Can list have duplicates in java?
Differentiate between postfix and prefix operators in java.
What is e in java?
What do you understand by casting in java language?
What is your platform’s default character encoding?
Difference between arraylist and vector.
Can we sort array in java?
What is the use of conditional statement?