Notizen
Exceptions
Inhalt der Notizen (2)
Seite 1
Exception
An Exception is a condition caused by run time error in the program.
When the java interpreter encounters an error,it creates an exception object and throws it.
If the exception object is not caught and handled properly the interpreter will display an error message.
If we want the program to run with the execution of remaining code , then we should try to catch the exception object thrown by the error condition and then display appropriate message for taking corrective actions.This task is known as Exception Handling.
Purpose of Exception handing is to provide a means to detect and report an exceptional circumstances.
Error handling performs the following task
Find the problem (hit the exception)
Inform that an error has occur (throw the exception)
Receive error information(catch the exception)
Take corrective actions(handle exceptions)
Seite 2
Common Java Exceptions
ArithmeticException - Caused by math errors such as division by zero.
ArrayIndexOutOfBoundException - Caused by bad array indexers.
ArrayStoreException - Caused when a program tries to store wrong type of data in an array.
FileNotFoundException - Caused by an attempt to access a non existent file.
IOException - Caused by general input output failure.
NullPointerException - Caused by referencing
NumberFormatException-caused when the connection btw string and number fails.
OutOfMemoryException-caused when there is no enough memory space to allocate an object.
SecurityException-caused when an applet tries to perform an action not allowed by the browser security settings.
Informationen
- Beschreibung
- JAVA Notiz am Exceptions, erstellt von shanid m am 11/10/2016.
- Erstellt von
- shanid m
- Aufrufe
- 1
- Bewertung