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

Is object a data type?

963


What is Session reduplication and how its done?

2035


When is the finalize() called?

1173


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

976


How to run a JAR file through command prompt?

1281


How can you avoid serialization in child class if the base class is implementing the serializable interface?

1082


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

1019


What are mutable classes?

1052


Explain the private protected method modifier?

981


What is argument in java?

1013


Does java allow overriding static methods ?

1112


What’s the difference between unit, integration and functional testing?

1104


What are the drawbacks of singleton class?

1002


What is scope of a variable?

1094


Is a copy constructor?

1052