throw and throws

prashantSum's Avatar
Contributor
what is the difference between throw and throws
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
throw
keyword that allows the user to throw an exception or any class that implements the "throwable" interface.

throws
keyword used in method declarations that specify which exceptions are not handled within the method but rather passed to the next higher level of the program.

I hope it clears the doubt in your mind.