package ex5;
public abstract class Person extends Aperson{
public abstract void say();
}
package ex5;
public class Chinese extends Person {
public void say()
{
System.out.println("Chinese speak Chinese");
}
}
package ex5;
public class American extends Person {
public void say()
{
System.out.println("Americans speak English");
}
}
package ex5;
public class Spain extends Person {
public void say()
{
System.out.println("Spains speak Spanish language");
}
}
package ex5;
public class Initail {
public static void main(String[] args) {
// TODO Auto-generated method stub
Person p1=new Chinese();
Person p2=new American();
Person p3=new Spain();
p1.say();
p2.say();
p3.say();
}
}`
`
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦