Tuesday, November 29, 2011

What is the difference between throw and throws clause, explain in programatically

Throw is used to throw an exception manually, where as throws is used in the case of checked exceptions, to reintimate the compiler that we have handled the exception. so throws is to be used at the time of defining a method and also at the time of calling that function, which rises an checked exception.
Category:Java Interview Questions

No comments:

Post a Comment