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
  • The ClassNotFoundException occurs when a java application is trying to load a class that is not on the 'classpath'.

  • java.lang.ArrayIndexOutOfBoundsException
  • The ArrayIndexOutOfBoundsException occurs when you are trying to access an item in an array that does not exist.

  • java.util.ConcurrentModificationException
  • The ConcurrentModificationException might occur when you are trying to alter a Collection while iterating over it.

  • java.lang.OutOfMemoryError
  • The OutOfMemoryError occurs when the 'Maximum Heap Size' for your application is reached.

  • java.lang.NullPointerException
  • The NullPointerException occurs when trying to call a method on an object that is 'null'.