Collection c = new ArrayList();

父类引用指向子类对象。new set; new hashset等 直接变,而不是写

ArrayList a = new ArrayList();

猜你喜欢

转载自ztao2333.iteye.com/blog/2296209