TOP 5 java exceptions
As a beginning Java programmer you will most likely 'struggle' with some exceptions. On the following pages the 5 most 'popular' exceptions are listed and explained.
- java.lang.ClassNotFoundException
- java.lang.ArrayIndexOutOfBoundsException
- java.util.ConcurrentModificationException
- java.lang.OutOfMemoryError
- java.lang.NullPointerException
The ClassNotFoundException occurs when a java application is trying to load a class that is not on the 'classpath'.
The ArrayIndexOutOfBoundsException occurs when you are trying to access an item in an array that does not exist.
The ConcurrentModificationException might occur when you are trying to alter a Collection while iterating over it.
The OutOfMemoryError occurs when the 'Maximum Heap Size' for your application is reached.
The NullPointerException occurs when trying to call a method on an object that is 'null'.
