Forums Register Login

difference B/w Throw and throws

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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...
You got style baby! More than this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1311 times.
Similar Threads
Difference
throws and throw
throw throws
Throws and throw
Dout in throws
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:21:45.