一些可以在面试中用的上的Java相关书籍的源码 public class ArrayVariance { class A {} class B extends A {} @Test public void showArrayVariance() { A a = new B(); assertTrue(a instanceof A); A[] arrayOfA = new B[] {new B()}; assertFalse(arrayOfA instanceof A[]); }