Why is the ArrayStoreException a RuntimeException?
问题 Let's say we have the following program: class Fruit {} class Apple extends Fruit {} class Jonathan extends Apple {} class Orange extends Fruit {} public class Main { public static void main(String[] args) { Fruit[] fruit = new Apple[10]; try { fruit[0] = new Fruit(); // ArrayStoreException fruit[0] = new Orange(); // ArrayStoreException } catch(Exception e) { System.out.println(e); } } } Based on the Java documentation: Thrown to indicate that an attempt has been made to store the wrong type