File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

difference B/w Throw and throws

kethare eswaran

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
marc weber

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
I agree. Here's the link:
subject: difference B/w Throw and throws
It's not a secret anymore!