Learn Java Programming - Exceptions: Throw Statement Tutorial

preview_player
Показать описание
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.
Рекомендации по теме
join shbcf.ru