本人是菜鸟,这个小程序编译一直不通过,求大神指点
江流002 2016-09-07 09:26:35 class jicheng
{
public static void main(String[] args)
{
new xuesheng1(23,"李四").study();
new xuesheng2(21,"王二").study();
//new xuesheng1(23,"李四").show();
//new xuesheng2(21,"王二").show();
System.out.println("Hello World!");
}
}
abstract class student
{
int age;
String name;
student(int age,String name )
{
this.name=name;
this.age=age;
}
abstract void study();
public void show()
{
System.out.print("name="+name,"age="+age);
}
}
class xuesheng1 extends student
{
xuesheng1(int age,String name)
{
super(age,name);
}
void study()
{
System.out.println("我会看代码");
}
}
class xuesheng2 extends student
{
xuesheng2(int age,String name)
{
super(age,name);
}
void study()
{
System.out.println("我会做开发");
}
}
本人是菜鸟,这个小程序编译一直不通过,求大神指点