Exercise 3 (page 1)Create necessary classes to describe this inheritance“Dog”,“Cat” (to be set by children classes) class Animal int age String type Animal() Animal(int age) void setAge(int age) int getAge() int compareTo(Animal o) void talk() class Dog extends Animal Dog() Dog(int age) void talk() class Cat extends Animal Cat() Cat(int age) void talk() Dog says“WUF-WUF” Cat says“MIEW-MIEW”
use“super”
use“super”
Display the type and age of animal
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库JAVE基础实验 Experiment3(4)在线全文阅读。
相关推荐: