1951: Animal_Dog_Cat

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:20 解决:20

题目描述

define abstract class as follows:

1)contains two data fields: name and color

2)define a no-arg constructor and a constructor with all data fields

3)define an abstract method,cry()

define a Dog class extending Animal class:

1)implement the abstract method: cry()

define a Cat class extending Animal class:

1)implement the abstract method: cry()


样例输入 复制

D kelly black 
C cherry white

样例输出 复制

kelly is barking
cherry is miaowing