abstract class Students
{
public abstract void study();
public void eat()
{
System.out.println("吃大餐");
}
}
class BaseStudents extends Students
{
public void study()
{
System.out.println("base study");
}
public void eat()
{
System.out.println("吃馒头");
}
class AdvStudents extends Students
{
public void study()
{
System.out.println("Adv study");
}
}
class DoStudents
{
public void DoSth(Students Stu)//DoSth-->Dosomething
{
Stu.study();
Stu.eat();
}
}
class DuotaiDemo3
{
public static void main(String[] args)
{
DoStudents ds=new DoStudents();
ds.DoSth(new BaseStudents());
ds.DoSth(new AdvStudents());
}
}
运行时提示错误:进行语法分析时已到达文件结尾,
请问哪错了,看不懂提示 |