BAEL-4285
BAEL-4285 A Guide to ArrayStoreException
This commit is contained in:
parent
14a81fffab
commit
e7bef17346
@ -0,0 +1,17 @@
|
||||
package com.baeldung.array;
|
||||
|
||||
public class ArrayStoreExceptionExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
try {
|
||||
Object array[] = new String[5];
|
||||
array[0] = 2;
|
||||
System.out.println(array[0]);
|
||||
} catch (ArrayStoreException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user