SlideShare una empresa de Scribd logo
1 de 7
Errors 
Compile time errors: These are syntactical errors found in 
the code, due to which a program fails to compile. E.g. 
missing semicolon at the end of statement, a statement 
without proper syntax etc. 
Run time errors: These errors represent inefficiency of the 
computer system to execute a particular statement. E.g. 
insufficient memory to store something or inability of the 
microprocessor to execute some statement come under 
run-time error. 
public static void main( )
Errors… 
Logical errors: These errors depict flaws in the logic of the 
program. The programmer might be using a wrong 
formula or the design of the program itself is wrong. 
Logical errors are not detected either by java compiler or 
JVM. 
Exceptions 
Checked: The exceptions that are checked at compilation 
time are called ‘Checked Exception’. 
Unchecked: The Exceptions that are checked by JVM are 
called ‘Unchecked Exceptions’.
Exceptions… 
Unchecked exceptions are considered as unrecoverable 
and the programmer cannot do any thing when they 
occur. Programmer can write a java program with 
unchecked exceptions, he can see their effect only when 
he runs the program. 
In case of checked exception, a programmer should either 
handle them or throw them without handling them. He 
cannot simply ignore the checked exception. 
public static void main(String args[]) throws IOException
Exceptions… 
class Test 
{ 
public static void main(String args[]) 
{ 
int n = args.length; 
int a = 45 / n; 
System.out.println(“The value of a is :”+a); 
} 
}
Exceptions Handling 
When there is an exception, the user data may be 
corrupted. To handle the exception, programmer should 
perform 3 steps: 
1. try{ 
Statements; 
} 
2. catch(Exceptionclass ref) { 
statements; 
} 
3. finally{ 
statements; 
}
Exception Handling… 
class Test 
{ 
public static void main(String args[]) 
{ 
try { 
int n = args.length; 
int a = 45 / n; 
System.out.println(“The value of a is :”+a); } 
catch(ArithmeticException ae) { 
System.out.println(ae); 
System.out.println(“Arguments are required”); } 
finally { 
System.out.println(“End of program”); } 
} 
}
Handling Multiple Exception 
class Test { 
public static void main(String args[]) { 
try { 
int n = args.length; 
int a = 45 / n; 
System.out.println(“The value of a is :”+a); 
int b[] = {10,20,30}; 
b[5] = 100; } 
catch(ArithmeticException ae) { 
System.out.println(ae); 
System.out.println(“Arguments are required”); } 
catch(ArrayIndexOutOfBoundsException aie) { 
aie.printStackTrace(); 
System.out.println(“Array index out of range”); } 
finally { 
System.out.println(“End of program”); } 
} }

Más contenido relacionado

La actualidad más candente

Exception handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaException handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaManoj_vasava
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javaravinderkaur165
 
Exception Handling Java
Exception Handling JavaException Handling Java
Exception Handling Javaankitgarg_er
 
Exception handling
Exception handlingException handling
Exception handlingHarry Potter
 
14 exception handling
14 exception handling14 exception handling
14 exception handlingjigeno
 
Exception Handling In Java 15734
Exception Handling In Java 15734Exception Handling In Java 15734
Exception Handling In Java 15734madhurendra pandey
 
Compiler design error handling
Compiler design error handlingCompiler design error handling
Compiler design error handlingRohitK71
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsAlan Richardson
 
Exception handling in JAVA
Exception handling in JAVAException handling in JAVA
Exception handling in JAVAKunal Singh
 
Exception handling in c
Exception handling in cException handling in c
Exception handling in cMemo Yekem
 
Exception handler
Exception handler Exception handler
Exception handler dishni
 
Exception handling in c programming
Exception handling in c programmingException handling in c programming
Exception handling in c programmingRaza Najam
 

La actualidad más candente (14)

Exception handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaException handling in c++ by manoj vasava
Exception handling in c++ by manoj vasava
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Exception Handling Java
Exception Handling JavaException Handling Java
Exception Handling Java
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
14 exception handling
14 exception handling14 exception handling
14 exception handling
 
Exception Handling In Java 15734
Exception Handling In Java 15734Exception Handling In Java 15734
Exception Handling In Java 15734
 
Compiler design error handling
Compiler design error handlingCompiler design error handling
Compiler design error handling
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStrings
 
Exception handling in JAVA
Exception handling in JAVAException handling in JAVA
Exception handling in JAVA
 
Exception handling in c
Exception handling in cException handling in c
Exception handling in c
 
Exception handler
Exception handler Exception handler
Exception handler
 
Exception handling in c programming
Exception handling in c programmingException handling in c programming
Exception handling in c programming
 
Presentation1
Presentation1Presentation1
Presentation1
 

Destacado

Handling inputs via io..continue
Handling inputs via io..continueHandling inputs via io..continue
Handling inputs via io..continuesimarsimmygrewal
 
Media Storyboard
Media StoryboardMedia Storyboard
Media StoryboardCloee Lang
 
Approaches_for_planning_the_ISS_cosmonau
Approaches_for_planning_the_ISS_cosmonauApproaches_for_planning_the_ISS_cosmonau
Approaches_for_planning_the_ISS_cosmonauNail Khusnullin
 
Photoshop project tutorial
Photoshop project tutorialPhotoshop project tutorial
Photoshop project tutorialmeyrni-ahmed
 
Análisis numérico - Cálculo numérico y manejo de errores
Análisis numérico - Cálculo numérico y manejo de erroresAnálisis numérico - Cálculo numérico y manejo de errores
Análisis numérico - Cálculo numérico y manejo de erroresdanielhp24
 
Engaging Service through Action
Engaging Service through ActionEngaging Service through Action
Engaging Service through ActionPavan Purswani
 

Destacado (11)

Handling inputs via io..continue
Handling inputs via io..continueHandling inputs via io..continue
Handling inputs via io..continue
 
Geometrical tolerance 2014
Geometrical tolerance 2014Geometrical tolerance 2014
Geometrical tolerance 2014
 
Media Storyboard
Media StoryboardMedia Storyboard
Media Storyboard
 
Java file
Java fileJava file
Java file
 
Approaches_for_planning_the_ISS_cosmonau
Approaches_for_planning_the_ISS_cosmonauApproaches_for_planning_the_ISS_cosmonau
Approaches_for_planning_the_ISS_cosmonau
 
Dracula
DraculaDracula
Dracula
 
tes
testes
tes
 
Photoshop project tutorial
Photoshop project tutorialPhotoshop project tutorial
Photoshop project tutorial
 
Repositorio digital
Repositorio digitalRepositorio digital
Repositorio digital
 
Análisis numérico - Cálculo numérico y manejo de errores
Análisis numérico - Cálculo numérico y manejo de erroresAnálisis numérico - Cálculo numérico y manejo de errores
Análisis numérico - Cálculo numérico y manejo de errores
 
Engaging Service through Action
Engaging Service through ActionEngaging Service through Action
Engaging Service through Action
 

Similar a Excception handling

Class notes(week 8) on exception handling
Class notes(week 8) on exception handlingClass notes(week 8) on exception handling
Class notes(week 8) on exception handlingKuntal Bhowmick
 
Java exception handling
Java exception handlingJava exception handling
Java exception handlingBHUVIJAYAVELU
 
Exception Handling In Java Presentation. 2024
Exception Handling In Java Presentation. 2024Exception Handling In Java Presentation. 2024
Exception Handling In Java Presentation. 2024kashyapneha2809
 
Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024nehakumari0xf
 
UNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and MultithreadingUNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and MultithreadingSakkaravarthiS1
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javaARAFAT ISLAM
 
Exception handling
Exception handlingException handling
Exception handlingRaja Sekhar
 
Class notes(week 8) on exception handling
Class notes(week 8) on exception handlingClass notes(week 8) on exception handling
Class notes(week 8) on exception handlingKuntal Bhowmick
 
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 handling in java
Exception handling in javaException handling in java
Exception handling in javaAmbigaMurugesan
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javagopalrajput11
 
Ch-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for allCh-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for allHayomeTakele
 
7.error management and exception handling
7.error management and exception handling7.error management and exception handling
7.error management and exception handlingDeepak Sharma
 
exceptionvdffhhhccvvvv-handling-in-java.ppt
exceptionvdffhhhccvvvv-handling-in-java.pptexceptionvdffhhhccvvvv-handling-in-java.ppt
exceptionvdffhhhccvvvv-handling-in-java.pptyjrtytyuu
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-ivRubaNagarajan
 

Similar a Excception handling (20)

Class notes(week 8) on exception handling
Class notes(week 8) on exception handlingClass notes(week 8) on exception handling
Class notes(week 8) on exception handling
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
 
Exception Handling In Java Presentation. 2024
Exception Handling In Java Presentation. 2024Exception Handling In Java Presentation. 2024
Exception Handling In Java Presentation. 2024
 
Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024
 
java exception.pptx
java exception.pptxjava exception.pptx
java exception.pptx
 
UNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and MultithreadingUNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and Multithreading
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Exception handling
Exception handlingException handling
Exception handling
 
UNIT 2.pptx
UNIT 2.pptxUNIT 2.pptx
UNIT 2.pptx
 
Class notes(week 8) on exception handling
Class notes(week 8) on exception handlingClass notes(week 8) on exception handling
Class notes(week 8) on 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 handling
Exception handlingException handling
Exception handling
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Z blue exception
Z blue   exceptionZ blue   exception
Z blue exception
 
Ch-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for allCh-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for all
 
7.error management and exception handling
7.error management and exception handling7.error management and exception handling
7.error management and exception handling
 
exceptionvdffhhhccvvvv-handling-in-java.ppt
exceptionvdffhhhccvvvv-handling-in-java.pptexceptionvdffhhhccvvvv-handling-in-java.ppt
exceptionvdffhhhccvvvv-handling-in-java.ppt
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
 

Más de simarsimmygrewal (7)

C file
C fileC file
C file
 
Java file
Java fileJava file
Java file
 
C file
C fileC file
C file
 
C++ file
C++ fileC++ file
C++ file
 
Handling inputs via scanner class
Handling inputs via scanner classHandling inputs via scanner class
Handling inputs via scanner class
 
Type casting
Type castingType casting
Type casting
 
Wrapper classes
Wrapper classesWrapper classes
Wrapper classes
 

Último

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 

Último (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

Excception handling

  • 1. Errors Compile time errors: These are syntactical errors found in the code, due to which a program fails to compile. E.g. missing semicolon at the end of statement, a statement without proper syntax etc. Run time errors: These errors represent inefficiency of the computer system to execute a particular statement. E.g. insufficient memory to store something or inability of the microprocessor to execute some statement come under run-time error. public static void main( )
  • 2. Errors… Logical errors: These errors depict flaws in the logic of the program. The programmer might be using a wrong formula or the design of the program itself is wrong. Logical errors are not detected either by java compiler or JVM. Exceptions Checked: The exceptions that are checked at compilation time are called ‘Checked Exception’. Unchecked: The Exceptions that are checked by JVM are called ‘Unchecked Exceptions’.
  • 3. Exceptions… Unchecked exceptions are considered as unrecoverable and the programmer cannot do any thing when they occur. Programmer can write a java program with unchecked exceptions, he can see their effect only when he runs the program. In case of checked exception, a programmer should either handle them or throw them without handling them. He cannot simply ignore the checked exception. public static void main(String args[]) throws IOException
  • 4. Exceptions… class Test { public static void main(String args[]) { int n = args.length; int a = 45 / n; System.out.println(“The value of a is :”+a); } }
  • 5. Exceptions Handling When there is an exception, the user data may be corrupted. To handle the exception, programmer should perform 3 steps: 1. try{ Statements; } 2. catch(Exceptionclass ref) { statements; } 3. finally{ statements; }
  • 6. Exception Handling… class Test { public static void main(String args[]) { try { int n = args.length; int a = 45 / n; System.out.println(“The value of a is :”+a); } catch(ArithmeticException ae) { System.out.println(ae); System.out.println(“Arguments are required”); } finally { System.out.println(“End of program”); } } }
  • 7. Handling Multiple Exception class Test { public static void main(String args[]) { try { int n = args.length; int a = 45 / n; System.out.println(“The value of a is :”+a); int b[] = {10,20,30}; b[5] = 100; } catch(ArithmeticException ae) { System.out.println(ae); System.out.println(“Arguments are required”); } catch(ArrayIndexOutOfBoundsException aie) { aie.printStackTrace(); System.out.println(“Array index out of range”); } finally { System.out.println(“End of program”); } } }