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 / anu mathew

throws:
Method capable of raising an exception but not handling the
same. i.e to say no Try Catch block is implemented in the
Method, to handle the exception.
The callers should create the Try Catch Block to safeguard
against the exception.
If the above is not followed it would result in Compilation
errors.

throw:
The method that raises the exception also handles the same
in its Catch block.
If unhandled the exception can also be handles by the
Callers Try Catch Block.
Hope this makes sense.

Is This Answer Correct ?    44 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why java is secure? Explain.

1048


How do you escape sequences in java?

1075


Does java support function overloading, pointers, structures, unions or linked lists?

1112


What is the final blank variable?

1139


How do you identify independent and dependent variables?

1008


What is method in research paper?

1137


What does t in java mean?

1004


How do you compare objects in java?

961


Explain about complier design(phases)

1085


What do you understand by java?

997


give an example for encapsulation?

1050


How can constructor chaining be done using this keyword?

1277


Can we make constructors static?

1241


What is a function argument in java?

1004


What is hashmap in java?

1062