为什么我的用了Cat还有错误
求大神指点
求大神指点
2017-06-24
you can add bellowing: //reason the ture for animal stands for the reference variable which means that it 's a way to point to the created Dog objective
Cat cat = new Cat(); // create a new cat type objective
Animal animal2 = cat; // assign the reference to a big type named animal2
Cat cat = (Cat) animal2; // cut down the extend length
举报