接口以及instanceof

所谓接口和继承有着相似的关系,一个叫接口继承,一个叫类继承; sysoutprintln{ Object[] objects = {new Tiger(), new Chicken(), new Apple}; for (int i=0; i < objects.length; i++) { if (objects[i] instanceof Edible) System.out •println
相关文章
相关标签/搜索