1. Use of Throw and Throws

Throw keyword is used to throw an exception explicitly.

Throws clause is used to declare an exception, which means it works similar to the try-catch block.

2. Method Flexibility

Throw keyword is used in the method body to throw an exception.

while throws is used in method signature to declare the exceptions that can occur in the statements present in the method.

3. Representation of Syntax

If we see syntax wise then throw is followed by an instance variable

while throws is followed by exception class names.

For example:

throw new ArithmeticException(“Arithmetic Exception”);


throws ArithmeticException;

4. Multiple Exceptions.

You cannot throw multiple exceptions.

But you can handle multiple exceptions by declaring them using throws keyword.

4 Thoughts on “Difference between Throw and Throws”

Leave a Reply

Your email address will not be published. Required fields are marked *