abstract class Student
{
private String name;
Student(){}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
abstract void study();
abstract void vacation();
}
class BaseStuden extends Student
{
void study()
{
System.out.println("基础班学员学习");
}
void vacation()
{
System.out.println("基础班学员休假");
}
}
class EmploymentStudent extends Student
{
void study()
{
System.out.println("就业班学员学习");
}
void vacation()
{
System.out.println("就业班学员休假");
}
}
class StudentTest
{
public static void main(String[] args)
{
BaseStuden bs = new BaseStuden();
bs.study();
bs.vacation();
EmploymentStudent es = new EmploymentStudent();
es.study();
es.vacation();
}
}
|
|