Runtime Exceptions in Java

Runtime exceptions are need not be handled by the programs. Generally RuntimeExceptions are exceptions that can be prevented programmatically.E.g NullPointerException, ArrayIndexOutOfBoundException. If we check for null value before calling any method, NullPointerException would never occur. These kind of exceptions should never be handled because that is not good practice. Java has 49 Runtime exceptions defined in its API. These all the exceptions extend the super class java.lang.RuntimeException. The below list is all the RuntimeExceptions as of Java 7 release.

  • AnnotationTypeMismatchException
  • ArithmeticException
  • ArrayStoreException
  • BufferOverflowException
  • BufferUnderflowException
  • CannotRedoException
  • CannotUndoException
  • ClassCastException
  • CMMException
  • ConcurrentModificationException
  • DataBindingException
  • DOMException
  • EmptyStackException
  • EnumConstantNotPresentException
  • EventException
  • FileSystemAlreadyExistsException
  • FileSystemNotFoundException
  • IllegalArgumentException
  • IllegalMonitorStateException
  • IllegalPathStateException
  • IllegalStateException
  • IllformedLocaleException
  • ImagingOpException
  • IncompleteAnnotationException
  • IndexOutOfBoundsException
  • JMRuntimeException
  • LSException
  • MalformedParameterizedTypeException
  • MirroredTypesException
  • MissingResourceException
  • NegativeArraySizeException
  • NoSuchElementException
  • NoSuchMechanismException
  • NullPointerException
  • ProfileDataException
  • ProviderException
  • ProviderNotFoundException
  • RasterFormatException
  • RejectedExecutionException
  • SecurityException
  • SystemException
  • TypeConstraintException
  • TypeNotPresentException
  • UndeclaredThrowableException
  • UnknownEntityException
  • UnmodifiableSetException
  • UnsupportedOperationException,
  • WebServiceException
  • WrongMethodTypeException

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Pin It on Pinterest

Share This

Share this post with your friends!

Share This

Share this post with your friends!