Explanations of common Java exceptions
Explanations to common Java exceptions


 
  
   java.lang
 

 
  ArithmeticException
  You are trying to use your computer to solve a mathematical problem that you cannot solve yourself. Read up on your arithmetics and try again.
 

 
  ArrayIndexOutOfBoundsException
  See IndexOutOfBoundsException. The difference is that this exception refers to more than one finger.
 

 
  ArrayStoreException
  You have used all your arrays and need to buy more from the array store.
 

 
  ClassCastException
  You need to stay in the class or caste you were born into. Java will not accept dailits acting as kshatriyas or noblemen pretending to be working class. Note the spelling mistake (of caste) that was introduced in Java 1.0 and has not been corrected for backwards compatability reasons.
 

 
  ClassNotFoundException
  You seem to have invented your own class. There are also caste systems that are not yet implemented in Java, most notibly the balinese caste system. For example, if you are a wesia, use the indian counterpart vaishya.
 

 
  CloneNotSupportedException
  You are a clone. Find the original you, tell him what you want to do and then kill yourself.
 

 
  IllegalAccessException
  You are a burgler that are running a Java program during a burglery. Please finish stealing the computer, leave the premises and try again.
 

 
  IllegalArgumentException
  You have tried to protest against a previous exception.
 

 
  IllegalMonitorStateException
  Please turn your computer screen back on.
 

 
  IllegalStateException
  You come from a state that is not yet recognized by the UN, possibly Kurdistan or Palestine. Get a real citizenship, recompile your java code and try again.
 

 
  IllegalThreadStateException
  One of the screws in your computer is threaded the wrong way. Please contact your hardware vendor.
 

 
  IndexOutOfBoundsException
  You have put your index finger in an unacceptable place. Reposition it and try again.
 

 
  InstantiationException
  Not everything can happen instantly. Please be more patient.
 

 
  InterruptedException
  Tell your colleagues, room-mates etc. to leave you alone while you are working.
 

 
  NegativeArraySizeException
  You have created an array with negative size. This can cause information to be lost and in the long run the Universe will be destroyed. Be happy that Java noticed what you were doing and DON'T DO IT AGAIN.
 

 
  NoSuchFieldException
  You are trying to have a picknick on a field that does not exist. You can also get this exception if you try to visit an airfield that in fact does exist, but has been classified as top-secret. I'd give you examples, but then I'd have to kill you.
 

 
  NoSuchMethodException
  Don't use that method! Please, do things like we have always done.
 

 
  NullPointerException
  You do not own a dog. Get one, for example a brittany spaniel, and try again.
 

 
  NumberFormatException
  You are using outdated units of measurement, for example inches or pints. Convert to SI. There is a known bug that causes this exception to be thrown if you are very short or tall.
 

 
  RuntimeException
  You cannot run fast enough, possibly due to obesity. Turn off your computer and go out and get som exercise.
 

 
  SecurityException
  You have been deemed a threat to nationaly security. Please sit still and wait for the authorities to come and get you.
 

 
  StringIndexOutOfBoundsException
  Your panties have shiften out of place. Adjust them and try again. You can also get this exception if you are not wearing any panties at all.
 

 
  UnsupportedOperationException
  You are trying to have an operation that for som reason, ethical or otherwise, is not supported by Java. Examples of this include unneeded amputations, for example circumcisions. Please stop abusing your body and do not remove pieces of you child, damn it!
 


 