SlideShare a Scribd company logo
1 of 23
EXCEPTION HANDLING
EXPLAINED BY HACKERS
PRESENTERS
• MUSKAN NAZEER
• AQSA ALTAF
• M. SHAHID
• M. WASEEM AKRAM
• M. AHMAD
• TALHA SHABBIR
AGENDA.
• What is Exception
• What is Exception Handling
• Exception Hierarchy in java
• Difference between Exception & Error.
• Types of Exception
• Types of Built-in- Exception
• Create and Handle Exception..
Exception
Exception Hierarchy
Exception Types.
Checked Exception
Unchecked Exception
Create & handle Exception
What is Exception
“An exception is an unexpected event, which occurs during the execution of a program i.e., at run
time, that disrupts the normal flow of the program.”
What is Exception handling:
“The Exception Handling in Java is one of the powerful mechanisms to handle the exception. in
program. so that the normal flow of the program can be maintained.”
Purpose:
The purpose of Exception handling is to detect and report an exception so that proper action can be
taken and prevent the program which is automatically terminate or stop the execution because of that
exception
Example:
Statement 1;
Statement 2;
Statement 3; (an exception occurs)
Statement 4;
Statement 5;
Suppose there are 5 Statements in a program and there occurs an exception at
Statement 3 the rest of the code of statement 3,4,5 will not be executed. If we
perform exception handling the rest of the statement will be executed.
If Exception occurs then we have two ways;
 pass the exception to its caller (using throws keyword)
 handle exception (using try, catch and finally keyword)
Keyword Used in Exception Handling are given:
Keywords Description
try
Java try block is used to enclose the code that might
throw an exception. The try block must be followed by
catch or finally.
catch
The "catch" block is used to handle the exception. It
must be followed by try block which means we can't
use catch block alone. catch block may be one or more
than one.
finally
The "finally" block is used to execute the necessary
code of the program. It is executed whether an
exception is handled or not.
Throws
The "throws" keyword is used to pass the exception to
its caller. It is always used with method signature.
Throw
“throw” keyword used to create user
define exception. it is used inside the method.
Exception Hierarchy in java
In the Java platform, many classes derive directly from Object, other classes derive from some of those
classes, and so on, forming a hierarchy of classes. Object is the parent class of all the classes in java.
Difference Between Exception and Error?
Exception Error
Exception occurs due to our Program. Error occurs due to lack of system resources.
Exception can be handled. Error cannot be handled.
Types:
Checked Exception
Unchecked Exception.
Type:
Unchecked Only.
Examples:
Null Pointer Exception, Array Index Out of Bounds
Exception, Class not Found Exception etc.
Examples:
Virtual Machine Error, Stack Over Flow Error,
Assertion Error, Linkage Error, Out of Memory Error,
etc..
Exception Types
Difference Between Built In exception and User Defined Exception?
Built In exception User Defined Exception
Built-in exceptions are the exceptions that are
already available in Java libraries.
Built-in exceptions are the exceptions that are not
available in Java libraries.
Predefined exceptions are raised implicitly
(Automatically) by the runtime system.
Predefined exception must be raised explicitly by
throw keyword.
Types:
Checked Exception
Unchecked exception
Types:
unchecked exception
Types of Built-in- Exception
 checked Exception:
 unchecked Exception.
Some exception are given:
 File Not Found Exception: This Exception is raised when a file is not accessible or does not exist.
 IO Exception: It is thrown when an input-output operation failed or interrupted
 NoSuchMethodException: It is thrown when accessing a method that is not found.
 Interrupted Exception: It is thrown when a thread is waiting, sleeping, or doing some processing, and it is
interrupted.
Checked Exception
“If compiler checks exception, then it is known as checked exception. These exceptions should be either
pass or handled during compile time. If we do not catch or handle them then the compiler will throw a
compilation error. These are the sub classes of the Exception class.”
FileNotFoundException:
Output:
Exception Handling
Output:
Unchecked Exception
If The compiler does not check exception it is known as unchecked exception. An unchecked exception (also
known as a runtime exception). Exceptions are checked at runtime.
Unchecked exceptions result from faulty logic that can occur anywhere in a software program. For example, if a
developer invokes a method on a null object, an unchecked NullPointerException occurs.
 Arithmetic Exception: It is thrown when an exceptional condition has occurred in an arithmetic operation.
 Array Index Out Of Bounds Exception: it occurs if we print out of bound array in program.
 Class Not Found Exception: it is occur if we delete the class of java file after comile.
 NoSuchMethodException: It is thrown when accessing a method that is not found.
 String Index out of Bounds Exception: It is thrown by String class methods to indicate that an index is either
negative or greater than the size of the string
Some exception are given:
ArithmeticException!
Handle Exception by Try Catch
Exception create ( by using throw keyword) Example
Output:
Exception Handling
output:
Execution
process
Catch block
Finally block
EXCEPTION HANDLING in prograaming

More Related Content

Similar to EXCEPTION HANDLING in prograaming

Exception Handling.pptx
Exception Handling.pptxException Handling.pptx
Exception Handling.pptxprimevideos176
 
7.error management and exception handling
7.error management and exception handling7.error management and exception handling
7.error management and exception handlingDeepak Sharma
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handlingkamal kotecha
 
Itp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & AssertionsItp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & Assertionsphanleson
 
exception -ppt.pptx
exception -ppt.pptxexception -ppt.pptx
exception -ppt.pptxDivyaKS18
 
Exception handling
Exception handlingException handling
Exception handlingpooja kumari
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javaravinderkaur165
 
Chap2 exception handling
Chap2 exception handlingChap2 exception handling
Chap2 exception handlingraksharao
 
Java-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handlingJava-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handlingraksharao
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javaKavitha713564
 
VTU MCA 2022 JAVA Exceeption Handling.docx
VTU MCA  2022 JAVA Exceeption Handling.docxVTU MCA  2022 JAVA Exceeption Handling.docx
VTU MCA 2022 JAVA Exceeption Handling.docxPoornima E.G.
 
A36519192_21789_4_2018_Exception Handling.ppt
A36519192_21789_4_2018_Exception Handling.pptA36519192_21789_4_2018_Exception Handling.ppt
A36519192_21789_4_2018_Exception Handling.pptpromila09
 
Exception handling
Exception handlingException handling
Exception handlingRaja Sekhar
 
Java SE 11 Exception Handling
Java SE 11 Exception HandlingJava SE 11 Exception Handling
Java SE 11 Exception HandlingAshwin Shiv
 
Interface andexceptions
Interface andexceptionsInterface andexceptions
Interface andexceptionssaman Iftikhar
 

Similar to EXCEPTION HANDLING in prograaming (20)

Exception handling
Exception handlingException handling
Exception handling
 
Exception Handling.pptx
Exception Handling.pptxException Handling.pptx
Exception Handling.pptx
 
7.error management and exception handling
7.error management and exception handling7.error management and exception handling
7.error management and exception handling
 
16 exception handling - i
16 exception handling - i16 exception handling - i
16 exception handling - i
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Itp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & AssertionsItp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & Assertions
 
exception -ppt.pptx
exception -ppt.pptxexception -ppt.pptx
exception -ppt.pptx
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Java exception
Java exception Java exception
Java exception
 
Chap2 exception handling
Chap2 exception handlingChap2 exception handling
Chap2 exception handling
 
Java-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handlingJava-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handling
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
CS3391 -OOP -UNIT – III NOTES FINAL.pdf
CS3391 -OOP -UNIT – III  NOTES FINAL.pdfCS3391 -OOP -UNIT – III  NOTES FINAL.pdf
CS3391 -OOP -UNIT – III NOTES FINAL.pdf
 
VTU MCA 2022 JAVA Exceeption Handling.docx
VTU MCA  2022 JAVA Exceeption Handling.docxVTU MCA  2022 JAVA Exceeption Handling.docx
VTU MCA 2022 JAVA Exceeption Handling.docx
 
A36519192_21789_4_2018_Exception Handling.ppt
A36519192_21789_4_2018_Exception Handling.pptA36519192_21789_4_2018_Exception Handling.ppt
A36519192_21789_4_2018_Exception Handling.ppt
 
Exception handling
Exception handlingException handling
Exception handling
 
Java unit 11
Java unit 11Java unit 11
Java unit 11
 
Java SE 11 Exception Handling
Java SE 11 Exception HandlingJava SE 11 Exception Handling
Java SE 11 Exception Handling
 
Interface andexceptions
Interface andexceptionsInterface andexceptions
Interface andexceptions
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

EXCEPTION HANDLING in prograaming

  • 2. PRESENTERS • MUSKAN NAZEER • AQSA ALTAF • M. SHAHID • M. WASEEM AKRAM • M. AHMAD • TALHA SHABBIR
  • 3. AGENDA. • What is Exception • What is Exception Handling • Exception Hierarchy in java • Difference between Exception & Error. • Types of Exception • Types of Built-in- Exception • Create and Handle Exception.. Exception Exception Hierarchy Exception Types. Checked Exception Unchecked Exception Create & handle Exception
  • 4. What is Exception “An exception is an unexpected event, which occurs during the execution of a program i.e., at run time, that disrupts the normal flow of the program.” What is Exception handling: “The Exception Handling in Java is one of the powerful mechanisms to handle the exception. in program. so that the normal flow of the program can be maintained.” Purpose: The purpose of Exception handling is to detect and report an exception so that proper action can be taken and prevent the program which is automatically terminate or stop the execution because of that exception
  • 5. Example: Statement 1; Statement 2; Statement 3; (an exception occurs) Statement 4; Statement 5; Suppose there are 5 Statements in a program and there occurs an exception at Statement 3 the rest of the code of statement 3,4,5 will not be executed. If we perform exception handling the rest of the statement will be executed. If Exception occurs then we have two ways;  pass the exception to its caller (using throws keyword)  handle exception (using try, catch and finally keyword)
  • 6. Keyword Used in Exception Handling are given: Keywords Description try Java try block is used to enclose the code that might throw an exception. The try block must be followed by catch or finally. catch The "catch" block is used to handle the exception. It must be followed by try block which means we can't use catch block alone. catch block may be one or more than one. finally The "finally" block is used to execute the necessary code of the program. It is executed whether an exception is handled or not. Throws The "throws" keyword is used to pass the exception to its caller. It is always used with method signature. Throw “throw” keyword used to create user define exception. it is used inside the method.
  • 7. Exception Hierarchy in java In the Java platform, many classes derive directly from Object, other classes derive from some of those classes, and so on, forming a hierarchy of classes. Object is the parent class of all the classes in java.
  • 8. Difference Between Exception and Error? Exception Error Exception occurs due to our Program. Error occurs due to lack of system resources. Exception can be handled. Error cannot be handled. Types: Checked Exception Unchecked Exception. Type: Unchecked Only. Examples: Null Pointer Exception, Array Index Out of Bounds Exception, Class not Found Exception etc. Examples: Virtual Machine Error, Stack Over Flow Error, Assertion Error, Linkage Error, Out of Memory Error, etc..
  • 10. Difference Between Built In exception and User Defined Exception? Built In exception User Defined Exception Built-in exceptions are the exceptions that are already available in Java libraries. Built-in exceptions are the exceptions that are not available in Java libraries. Predefined exceptions are raised implicitly (Automatically) by the runtime system. Predefined exception must be raised explicitly by throw keyword. Types: Checked Exception Unchecked exception Types: unchecked exception
  • 11. Types of Built-in- Exception  checked Exception:  unchecked Exception.
  • 12. Some exception are given:  File Not Found Exception: This Exception is raised when a file is not accessible or does not exist.  IO Exception: It is thrown when an input-output operation failed or interrupted  NoSuchMethodException: It is thrown when accessing a method that is not found.  Interrupted Exception: It is thrown when a thread is waiting, sleeping, or doing some processing, and it is interrupted. Checked Exception “If compiler checks exception, then it is known as checked exception. These exceptions should be either pass or handled during compile time. If we do not catch or handle them then the compiler will throw a compilation error. These are the sub classes of the Exception class.”
  • 15. Unchecked Exception If The compiler does not check exception it is known as unchecked exception. An unchecked exception (also known as a runtime exception). Exceptions are checked at runtime. Unchecked exceptions result from faulty logic that can occur anywhere in a software program. For example, if a developer invokes a method on a null object, an unchecked NullPointerException occurs.  Arithmetic Exception: It is thrown when an exceptional condition has occurred in an arithmetic operation.  Array Index Out Of Bounds Exception: it occurs if we print out of bound array in program.  Class Not Found Exception: it is occur if we delete the class of java file after comile.  NoSuchMethodException: It is thrown when accessing a method that is not found.  String Index out of Bounds Exception: It is thrown by String class methods to indicate that an index is either negative or greater than the size of the string Some exception are given:
  • 17. Handle Exception by Try Catch
  • 18.
  • 19. Exception create ( by using throw keyword) Example