The throw keyword is used to manually cause an exception to occur. A throw statement can throw either a checked or unchecked exception.
The structure of a throw statement looks like this:
( throw ) ( new ) ( ExceptionClass(argument list) )( ; )
In this tutorial I will demonstrate how to throw an unchecked exception. Throwing a checked exception requires an understanding how to use the throws keyword, so I will demonstrate how to throw a checked exception in my next tutorial.
On this page of the site you can watch the video online Learn Java Programming - Exceptions: Throw Statement Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Daniel Ross 14 September 2015, share the link with friends and acquaintances, this video has already been watched 2,345 times on youtube and it was liked by 17 viewers. Enjoy your viewing!