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 is type safety in java?

905


What is the nested interface?

1043


Can a variable be local and static at the same time?

947


What is binary tree in java?

1007


What is default switch case? Give example.

954


What is the default access specifier for variables and methods of a class?

1140


What is meant by object oriented programming – oop?

926


Is it necessary that each try block must be followed by a catch block?

973


What is immutability in java?

1037


Which collection is best for sorting in java?

1068


Why hashset is used in java?

1003


Explain the protected field modifier?

1028


What is vector?

996


What do you mean by constant time complexity?

1142


Why we go for collections in java?

926