SLIDE JAVA 05 LIDE JAVA 05 16/1Exceptions Exceptions Reading: Savitch, Chapter 816/2ObjectivesObjectivesTo learn what an exception is.To learn how to handle an exception.16/3What is an Exception?What is an Exception?An exception is an object that describes an unexpected situation.Definition: An exception is an event that occurs during the execution of a program that disrupts the normal flow of instructions. 16/4Exampleint a = 4, b = 4;int [ ] intAy = new int[4];intAy[0] = a/(a - b); //this will generate and throw an ArithmeticException //objectfor(int k = 1; k