Throwing Some Throws

In this lesson, we'll walk through the syntax and usage of the throws keyword.

Declaring throws

The throw keyword is mainly used in a method’s body. We can use the throw keyword multiple times.

However, we can also declare exceptions in the method’s signature using another keyword, i.e, throws.

Get hands-on with 1200+ tech skills courses.