Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is string a class in java?

963


What is meant by data hiding/encapsulation?

1087


Can we create an object of private class?

950


What is the difference amongst jvm spec, jvm implementation, jvm runtime ?

946


What advantage do java's layout managers provide over traditional windowing systems?

941


What is data movement?

1115


Write a function to print Fibonacci series and Tribonacci series?

1164


What is wrapper class html?

917


Will the jvm load the package twice at runtime?

1081


What is the static variable?

1109


How does arraylist work in java?

1094


What is the size of integer?

1082


How do you square a number?

1242


What is a jit compiler?

1110


What is classpath?

991