SlideShare a Scribd company logo
1 of 25
Exceptions & its Handling
What’s this Exception ,[object Object],Class Test { public static void main(String[] args) { System.out.println( 6/0 ); System.out.println( “Hello” ); // do something else } } Exception in thread "main" java.lang.ArithmeticException: / by zero at NewClass.main(NewClass.java:20)
Throwing an Exception ,[object Object],[object Object]
Understanding the Call Stack ,[object Object],[object Object],[object Object],[object Object],y(),  where exception occured x() main() Class Test { public static void main(String[] args) { x();  } void x() { y();  } void y() { int a = 7/0; } }
Exception Handler ,[object Object],[object Object],[object Object],[object Object]
Searching for the Exception Handler in the call stack ,[object Object],y(),  where exception occured x() main() throws exception should handle but  may forward exception Looking for appropriate handler Looking for appropriate handler should handle but  may forward exception
Catch or Specify Requirement ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Types : 3 ,[object Object],[object Object],[object Object],UnChecked Exception
Class Hierarchy java.lang.Object java.lang.Throwable java.lang.Error java.lang.Exception java.lang.RuntimeException
Checked Exception ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Runtime Exception ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Error ,[object Object],[object Object],[object Object],[object Object]
Runtime Exception due to Logical Errors  public class NewClass  {  public static void main(String[] args) { int array[] = {6,7,8,9,10}; for(int index=0; index<array.length+2; index++) System.out.print(array[index]+” “); System.out.println(&quot;After loop&quot;); } } 6 7 8 9 10 Exception in thread &quot;main&quot;java.lang.ArrayIndexOutOfBoundsException: 5 at NewClass.main(NewClass.java:22)
Runtime Exception due to Logical Errors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1st statement Exception in thread &quot;main&quot; java.lang.NullPointerException at NewClass.main(NewClass.java:21)
Runtime Exception due to improper use of API ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Exception in thread &quot;main&quot; java.lang.NullPointerException at NewClass.main(NewClass.java:30) new thread  new thread  new thread  new thread  new thread  new thread  new thread  new thread  new thread  new thread
Runtime Exception due to improper use of API ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],First statement Exception in thread &quot;main&quot; java.lang.ClassCastException: java.lang.String   at Test.m(NewClass.java:27)   at Test.main(NewClass.java:21)
Dealing with Exception ,[object Object],public class NewClass  {  public static void main(String[] args) { int array[] = {6,7,8,9,10}; try{ for(int index=0; index<array.length+2; index++) } catch(Exception e) {  System.out.println(“Element with this index doen’t exist”);  } System.out.print(array[index]+” “); System.out.println(&quot;After loop&quot;); } }
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using finally block ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException IndexOutOfBoundsException ArrayIndexOutOfBoundsException StringIndexOutOfBoundsException
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Handling Checked Exceptions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],try{ } catch(FileNotFoundException e) { //….. } throws FileNotFoundException try{ } catch(IOException e) { //….. } throws FileNotFoundException
Creating Custom UnChecked Exceptions public class NewClass  {  public static void main(String[] args) { m();  }  static void m() {  throw new MyException(); } } class MyException extends RuntimeException { MyException() {  super(&quot;This is my exception&quot;);  } } Exception in thread &quot;main&quot; Pack.MyException: This is my exception at NewClass.m(NewClass.java:24) at NewClass.main(NewClass.java:20)
Creating Custom Checked Exceptions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

L14 exception handling
L14 exception handlingL14 exception handling
L14 exception handlingteach4uin
 
Java - Exception Handling
Java - Exception HandlingJava - Exception Handling
Java - Exception HandlingPrabhdeep Singh
 
Exception handling in Java
Exception handling in JavaException handling in Java
Exception handling in JavaPrasad Sawant
 
Chap2 exception handling
Chap2 exception handlingChap2 exception handling
Chap2 exception handlingraksharao
 
Exceptions ref
Exceptions refExceptions ref
Exceptions ref. .
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVASURIT DATTA
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling sharqiyem
 
Exception handling
Exception handlingException handling
Exception handlingpooja kumari
 
Types of exceptions
Types of exceptionsTypes of exceptions
Types of exceptionsmyrajendra
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overviewBharath K
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in JavaVadym Lotar
 
Exception Handling
Exception HandlingException Handling
Exception HandlingSunil OS
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javagopalrajput11
 
Exception handling in c
Exception handling in cException handling in c
Exception handling in cMemo Yekem
 
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
 

What's hot (20)

Exception handling
Exception handlingException handling
Exception handling
 
Exception
ExceptionException
Exception
 
L14 exception handling
L14 exception handlingL14 exception handling
L14 exception handling
 
Java - Exception Handling
Java - Exception HandlingJava - Exception Handling
Java - Exception Handling
 
Exception handling in Java
Exception handling in JavaException handling in Java
Exception handling in Java
 
Chap2 exception handling
Chap2 exception handlingChap2 exception handling
Chap2 exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Exceptions ref
Exceptions refExceptions ref
Exceptions ref
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Types of exceptions
Types of exceptionsTypes of exceptions
Types of exceptions
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overview
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in Java
 
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
 
Exception handling in c
Exception handling in cException handling in c
Exception handling in c
 
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
 

Viewers also liked

Deception, Propaganda & Epistemology on the Anti-Social Web
Deception, Propaganda & Epistemology on the Anti-Social WebDeception, Propaganda & Epistemology on the Anti-Social Web
Deception, Propaganda & Epistemology on the Anti-Social WebJessie Daniels
 
Lo aprendido en 9°
Lo aprendido en 9°Lo aprendido en 9°
Lo aprendido en 9°evelyntv22
 
Democraciacomoformadegobierno 100521225402-phpapp02
Democraciacomoformadegobierno 100521225402-phpapp02Democraciacomoformadegobierno 100521225402-phpapp02
Democraciacomoformadegobierno 100521225402-phpapp02ReyDa Chokki
 
Programa educativo les 2007
Programa educativo les 2007Programa educativo les 2007
Programa educativo les 2007LESGabriela
 
Grupo I.AdmóN CientíFica Y CláSica Trb
Grupo I.AdmóN CientíFica Y CláSica TrbGrupo I.AdmóN CientíFica Y CláSica Trb
Grupo I.AdmóN CientíFica Y CláSica Trbfombona
 

Viewers also liked (9)

Que es el metodo cientifico
Que es el metodo cientificoQue es el metodo cientifico
Que es el metodo cientifico
 
Seccion 2
Seccion 2Seccion 2
Seccion 2
 
Humanidades
HumanidadesHumanidades
Humanidades
 
Deception, Propaganda & Epistemology on the Anti-Social Web
Deception, Propaganda & Epistemology on the Anti-Social WebDeception, Propaganda & Epistemology on the Anti-Social Web
Deception, Propaganda & Epistemology on the Anti-Social Web
 
Guia 13
Guia  13Guia  13
Guia 13
 
Lo aprendido en 9°
Lo aprendido en 9°Lo aprendido en 9°
Lo aprendido en 9°
 
Democraciacomoformadegobierno 100521225402-phpapp02
Democraciacomoformadegobierno 100521225402-phpapp02Democraciacomoformadegobierno 100521225402-phpapp02
Democraciacomoformadegobierno 100521225402-phpapp02
 
Programa educativo les 2007
Programa educativo les 2007Programa educativo les 2007
Programa educativo les 2007
 
Grupo I.AdmóN CientíFica Y CláSica Trb
Grupo I.AdmóN CientíFica Y CláSica TrbGrupo I.AdmóN CientíFica Y CláSica Trb
Grupo I.AdmóN CientíFica Y CláSica Trb
 

Similar to Exceptions &amp; Its Handling

Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024nehakumari0xf
 
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
Java exception handlingJava exception handling
Java exception handlingBHUVIJAYAVELU
 
Exception handling in java.pptx
Exception handling in java.pptxException handling in java.pptx
Exception handling in java.pptxNagaraju Pamarthi
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-ivRubaNagarajan
 
Exception Handling
Exception HandlingException Handling
Exception HandlingReddhi Basu
 
8.Exception handling latest(MB).ppt .
8.Exception handling latest(MB).ppt      .8.Exception handling latest(MB).ppt      .
8.Exception handling latest(MB).ppt .happycocoman
 
130410107010 exception handling
130410107010 exception handling130410107010 exception handling
130410107010 exception handlingHemant Chetwani
 
Unit 4 exceptions and threads
Unit 4 exceptions and threadsUnit 4 exceptions and threads
Unit 4 exceptions and threadsDevaKumari Vijay
 
9781439035665 ppt ch11
9781439035665 ppt ch119781439035665 ppt ch11
9781439035665 ppt ch11Terry Yoast
 
Exception Handling.pptx
Exception Handling.pptxException Handling.pptx
Exception Handling.pptxprimevideos176
 

Similar to Exceptions &amp; Its Handling (20)

java exception.pptx
java exception.pptxjava exception.pptx
java exception.pptx
 
Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024Java-Exception Handling Presentation. 2024
Java-Exception Handling Presentation. 2024
 
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
Java exception handlingJava exception handling
Java exception handling
 
exception handling
exception handlingexception handling
exception handling
 
Exception handling in java.pptx
Exception handling in java.pptxException handling in java.pptx
Exception handling in java.pptx
 
UNIT 2.pptx
UNIT 2.pptxUNIT 2.pptx
UNIT 2.pptx
 
Nalinee java
Nalinee javaNalinee java
Nalinee java
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
 
Exception Handling
Exception HandlingException Handling
Exception Handling
 
8.Exception handling latest(MB).ppt .
8.Exception handling latest(MB).ppt      .8.Exception handling latest(MB).ppt      .
8.Exception handling latest(MB).ppt .
 
Chap12
Chap12Chap12
Chap12
 
17 exceptions
17   exceptions17   exceptions
17 exceptions
 
130410107010 exception handling
130410107010 exception handling130410107010 exception handling
130410107010 exception handling
 
Unit 4 exceptions and threads
Unit 4 exceptions and threadsUnit 4 exceptions and threads
Unit 4 exceptions and threads
 
Java unit3
Java unit3Java unit3
Java unit3
 
9781439035665 ppt ch11
9781439035665 ppt ch119781439035665 ppt ch11
9781439035665 ppt ch11
 
Z blue exception
Z blue   exceptionZ blue   exception
Z blue exception
 
Exception handling in java
Exception handling in java Exception handling in java
Exception handling in java
 
Exception Handling.pptx
Exception Handling.pptxException Handling.pptx
Exception Handling.pptx
 

More from Bharat17485

Channel Based Io
Channel Based IoChannel Based Io
Channel Based IoBharat17485
 
Developing Multithreaded Applications
Developing Multithreaded ApplicationsDeveloping Multithreaded Applications
Developing Multithreaded ApplicationsBharat17485
 
Interfaces &amp; Abstract Classes
Interfaces &amp; Abstract ClassesInterfaces &amp; Abstract Classes
Interfaces &amp; Abstract ClassesBharat17485
 
Primitive Wrappers
Primitive WrappersPrimitive Wrappers
Primitive WrappersBharat17485
 
Regular Expression
Regular ExpressionRegular Expression
Regular ExpressionBharat17485
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input OutputBharat17485
 
Applying Generics
Applying GenericsApplying Generics
Applying GenericsBharat17485
 

More from Bharat17485 (12)

Channel Based Io
Channel Based IoChannel Based Io
Channel Based Io
 
Core Java
Core JavaCore Java
Core Java
 
Developing Multithreaded Applications
Developing Multithreaded ApplicationsDeveloping Multithreaded Applications
Developing Multithreaded Applications
 
Interfaces &amp; Abstract Classes
Interfaces &amp; Abstract ClassesInterfaces &amp; Abstract Classes
Interfaces &amp; Abstract Classes
 
Enum
EnumEnum
Enum
 
Jstl &amp; El
Jstl &amp; ElJstl &amp; El
Jstl &amp; El
 
Primitive Wrappers
Primitive WrappersPrimitive Wrappers
Primitive Wrappers
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input Output
 
String Handling
String HandlingString Handling
String Handling
 
Swing
SwingSwing
Swing
 
Applying Generics
Applying GenericsApplying Generics
Applying Generics
 

Recently uploaded

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Exceptions &amp; Its Handling

  • 1. Exceptions & its Handling
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Class Hierarchy java.lang.Object java.lang.Throwable java.lang.Error java.lang.Exception java.lang.RuntimeException
  • 10.
  • 11.
  • 12.
  • 13. Runtime Exception due to Logical Errors public class NewClass { public static void main(String[] args) { int array[] = {6,7,8,9,10}; for(int index=0; index<array.length+2; index++) System.out.print(array[index]+” “); System.out.println(&quot;After loop&quot;); } } 6 7 8 9 10 Exception in thread &quot;main&quot;java.lang.ArrayIndexOutOfBoundsException: 5 at NewClass.main(NewClass.java:22)
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException IndexOutOfBoundsException ArrayIndexOutOfBoundsException StringIndexOutOfBoundsException
  • 21.
  • 22.
  • 23.
  • 24. Creating Custom UnChecked Exceptions public class NewClass { public static void main(String[] args) { m(); } static void m() { throw new MyException(); } } class MyException extends RuntimeException { MyException() { super(&quot;This is my exception&quot;); } } Exception in thread &quot;main&quot; Pack.MyException: This is my exception at NewClass.m(NewClass.java:24) at NewClass.main(NewClass.java:20)
  • 25.