📜  什么是 throw 关键字用于 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:34.253000             🧑  作者: Mango

代码示例1
Generally JVM throws the exception and
we handle the exceptions by 
using try catch block. But there are
situations where we have to throw 
userdefined exceptions or runtime exceptions.
  In such case we use throw keyword 
to throw exception explicitly.

  Syntax : throw throwableInstance;