Skip to content

Instantly share code, notes, and snippets.

@javamultiplex
Created October 19, 2017 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javamultiplex/25850ed4fc0633a31548529a8e95c6aa to your computer and use it in GitHub Desktop.
Save javamultiplex/25850ed4fc0633a31548529a8e95c6aa to your computer and use it in GitHub Desktop.
Example of ArrayStoreException present in java.lang package
package com.javamultiplex.java.lang.exceptions;
/**
* @author Rohit Agarwal
* @version 1.0
* @category java.lang/Exception
* @since JDK 1.0
*/
public class ArrayStoreExceptionDemo {
public static void main(String[] args) {
Object[] str = new String[3];
/*
* ArrayStoreException will be thrown because we are trying to store int
* value in String array.
*/
str[0] = new Integer(12);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment