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

What is difference between checked and unchecked exception in java?

1020


what is aggregation in java?

1016


Where are the local variables stored?

1073


In case of inheritance what is the execution order of constructor and destructor?

1134


Differentiate between a class and an object.

1033


What is the symbol for space?

1000


How objects of a class are created if no constructor is defined in the class?

1072


How does multithreading take place on a computer with a single cpu in java programming?

1015


Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

1169


What is array length in java?

964


According to java operator precedence, which operator is considered to be with highest precedence?

1087


How do I type unicode?

982


What is the difference between JDBC 1.0 and JDBC 2.0?

3186


What is variable length arguments in java?

976


What is a platform?

1078