 
		追风的纸鸢
2019-05-11 13:45
public class Initial{
public static void main(String args[]) {
People people=new Chinese();
people.speak();
}
}
 
				已经多态了 你好像还没明白面向对象知识 先再看一遍吧 我的建议
 
				这不已经是多态了吗?父类引用指向子类对象
 
				new Chinese().speak
 
				new Chinese().speak;
 
				这两句没有必要合并吧
 
				public class Initial{
public static void main(String args[]) {
People people=new Chinese(){
people.speak();
}
}
}
Java入门第二季
531292 学习 · 6327 问题
相似问题