package lena11;
public class lele{
public static void main(String[] args) {
mathTeacher mr=new mathTeacher();
mr.name=“Mr.huang”;
englishTeacher et=new englishTeacher();
et.name=“Miss.lin”;
mr.show();
et.show();
}
}
abstract class Teacher{
String name;
public abstract void show();
}
class mathTeacher extends Teacher{
String name;
@Override
public void show() {
System.out.println(name+"正在上数学课");
}
}
class englishTeacher extends Teacher{
String name;
@Override
public void show() {
// TODO Auto-generated method stub
System.out.println(name+"正在上英语课");
}
}