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 immutability in java?

1075


What is javac_g?

1012


What is the range of the short type?

1019


What is class level lock ?

1028


Is java type safe?

956


How can we create a synchronized collection from given collection?

1080


How do you reverse a word in java?

1072


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

1023


Explain when classnotfoundexception will be raised ?

1036


What is arraylist e in java?

1053


What are internal and external variables?

955


what are the states associated in the thread? : Java thread

1043


Is linkedlist thread safe in java?

991


How many threads can I run java?

1111


Is sizeof a keyword in java programming?

1065