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 differences between stringbuffer and stringbuilder?

1064


How would overload a function based on return type?

973


Can you instantiate the math class?

1061


What is oops in java?

1022


What is difference between iterator access and index access?

1064


What do you meant by active and passive objects?

1087


What is a parent class in java?

1019


What is Java Package and which package is imported by default?

1097


What is the difference between checked exception and unchecked exception?

1017


In which order the iterator iterates over collection?

996


What is unicode datatype?

967


What does function identity () do?

968


Is integer passed by reference in java?

1019


what is function overloading in java?

1306


What is treeset and treemap in java?

1071