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...

what is difference between throw and throws in exception?

Answer Posted / balu

throws clause is used when the programmer does not want to handle the exception and throw it out of a method.
throw clause is used when the programmer wants to throw an exception explicitly and wants to handle it using catch block hence throw and throws are contradictory.
throw clause can be used to throw our own exceptions also i.e user-defined exceptions.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of sorting in java?

1026


Can set contain duplicates?

1051


What are the topics in core java?

1130


When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?

1095


Why is the main method static?

1218


What is a boolean output?

1026


Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?

1072


What is boolean data type in java?

1043


Which variables are stored in stack?

953


How can you add and remove nodes in jtree?

1107


What are inner classes or non static nested classes in java?

1218


What are the drawbacks of reflection?

1061


How many return statement are allowed in a function?

986


Differentiate between class and structure.

1186


What are the advantages of java over cpp?

1127