aspose file tools*
The moose likes Java in General and the fly likes difference B/w  Throw and throws Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "difference B/w  Throw and throws" Watch "difference B/w  Throw and throws" New topic
Author

difference B/w Throw and throws

kethare eswaran
Greenhorn

Joined: Jul 10, 2006
Posts: 8
Wat is the difference between the Keywords "THROW" and "THROWS"

Is the THROWS doesnot have any per defined methods as throw

Can u Expline working of THROWS in the Try catch block kethare@sify.com
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Welcome to JavaRanch!

The keyword throws is a declaration "warning" that the associated method or class might throw the indicated exception(s). The keyword throw is used to actually throw something. For example...

In general, if an exception is caught, then it is considered handled and does not need to be declared with the keyword throws. For example...


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
wood burning stoves
 
subject: difference B/w Throw and throws