Difference between throw & throws in java

This is an important question which is generally asked in exams or in interview. The following are the differences between the throw and throws keyword in java.

throw throws
1. throw keyword is generally used to explicitly throw an exception 1. throws keyword is generally used to declare an exception.
2. Only unchecked exceptions can be propagated using throw keyword by default. 2. Checked exceptions are propagated with the help of throws keyword.
3. throw keyword can be used within the method. 3. throws keyword is used with the method signature.
4. One cannot throw multiple exceptions at a time. 4. One can declare multiple exceptions using throws keyword.
5. throw is followed by an instance 5. throws is followed by class
6. Example:
void main()
{
throw new ArithmeticException(“Link Fail”);
}
6. Example:
void m() throws ArithmeticException
{
// method body
}