JAVA DESIGN PATTERN Questions and Answers

Mention what is the difference between “throw” and “throws”?

Keyword “Throw” is used to explicitly throw as an exception, while “Throws” is utilized to handle checked exceptions for re-intimating the compiler that exceptions are being handled.   The throws need to be used in the method’s definition and also while invoking the method that raises checked exceptions.