Open In App

ArrayStoreException in Java

ArrayStoreException in Java occurs whenever an attempt is made to store the wrong type of object into an array of objects. The ArrayStoreException is a class which extends RuntimeException, which means that it is an exception thrown at the runtime.

Class Hierarchy:



java.lang.Object
↳ java.lang.Throwable
    ↳ java.lang.Exception
        ↳ java.lang.RuntimeException
            ↳ java.lang.ArrayStoreException 

Constructors of ArrayStoreException:

  1. ArrayStoreException(): Constructs an ArrayStoreException instance with no detail message.
  2. ArrayStoreException(String s): Constructs an ArrayStoreException instance with the specified message s.

Article Tags :