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 are the features in java?

1077


why java does not support unsigned keyword?

5264


Can we convert stringbuffer to string?

1014


Is 64bit faster than 32 bit?

1072


Explain the usage of this with constructors?

1028


How many bytes is a string java?

1031


What are variable arguments or varargs?

1009


What is the common usage of serialization? What exceptions occur during serialization?

1130


What is arraylist class in java?

1071


What is the difference between size and length in java?

976


What is variable and example?

967


Is there any difference between nested classes and inner classes?

1100


Explain what do you mean by functional overloading in java?

1023


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

1088


Define reflection.

1002