abstract class Teacher
{
private String name;
private int age;
public Teacher (){}
public void Teacher(String name,int age){
this.name=name;
this.age=age;
}
public void setName(String name){
this.name=name;
}
public String getName(){
return name;
}
public void setAge(int age){
this.age=age;
}
public int getAge(){
return age;
}
public abstract void teach();
public void show(){
System.out.println(name+age);
}
}
class BaseTeacher extends Teacher
{
public BaseTeacher (){
System.out.println("基础班教师");
}
public void teach(){
System.out.println("基础班教Javase");
}
}
class WorkerTeacher extends Teacher
{
public WorkerTeacher (){
System.out.println("jiuye班教师");
}
public void teach(){
System.out.println("jiuye班教Javaee");
}
}
class Test4
{
public static void main(String[] args)
{
Teacher t=new BaseTeacher();
t.setName("夯哥");
t.setAge(20);
t.show();
t.teach();