Java: Java Programming For Beginners a simple Start To Java Programming (Written By a software Engineer)


Download 0.82 Mb.
Pdf ko'rish
bet68/95
Sana09.01.2022
Hajmi0.82 Mb.
#261112
1   ...   64   65   66   67   68   69   70   71   ...   95
Bog'liq
Java Programming For Beginners - A Simple Start to Java Programming ( PDFDrive )

Creating An Exception
You can make your own exemptions in Java. Remember the accompanying focuses when
composing your classes for exceptions:
All exemptions must be an offspring of Throwable.
If  you  need  to  compose  a  checked  exemption  that  is  naturally  authorized  by  the
Handle or Declare Rule, you have to create an extension of the Exception class.
If you need to compose a runtime exemption, you will have to create an extension
of the Runtimeexception class.
You can create your own exceptions using the following structure:
class MyNewException extends Exception{ }

Download 0.82 Mb.

Do'stlaringiz bilan baham:
1   ...   64   65   66   67   68   69   70   71   ...   95




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling