class ZuoYe_QianoDaiMa {
public static void main(String[] args) {
person p = new 李华();
System.out.println(p.name);
p.talkTrade();
李华 lh = (李华)p;
lh.show();
}
}
class person{
String name = "小明";
int age = 23;
public void talkTrade(){
System.out.println("撩妹");
}
}
class 李华 extends person {
String name = "李华";
public void talkTrade(){
System.out.println("撩妹专家");
}
public void show(){
System.out.println("带撩妹");
}
} |
|