What are the difference between throw and throws?
Differences are between throws and throw are:
- Throw is employed to trigger an exception while throws is used in declaration of exception.
- Without throws, checked exception can't be handled while checked exception can be propagated with throws.
- Throws is used with the method signature while throw is used inside the method.
- Throw is followed by an instance however throws is followed by class.