求源代码
public class AbstDemo {
public static void main(String[] args) {
Person p1 = new Chinese();
Person p2 = new American();
p1.say();
p2.say();
}
}
abstract class Person{
abstract void say();
}
class Chinese extends Person{
void say() {
System.out.println("中国人说汉语");
}
}
class American extends Person{
void say() {
System.out.println("美国人说英语");
}
}