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 / ritesh

Whenever we want to force an exception then we use throw keyword.Moreover throw keyword can also be used to pass a custom message to the exception handling module i.e. the message which we want to be printed.
Whereas when we know that a particular exception may be thrown or to pass a possible exception then we use throws keyword

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between class and object in java?

1131


Which collection does not allow duplicates in java?

1029


Can you extend singleton class?

1155


What is arrays sort in java?

1023


How do you add an element to an arraylist in java?

995


What are different data structures in java?

1086


What are the benefits of operations in java?

1129


Can inner class final?

1157


What are loops in java? What are three types of loops?

1072


What are invisible components?.

2189


What is nextint java?

1128


What is difference between path and classpath variables?

1150


List the interfaces which extends collection interface?

998


What is anti pattern in java?

1032


Can each java object keep track of all the threads that want to exclusively access it?

994