帮你把程序修改了一下,可以通过了:- abstract class Fl{
- int age;
- String name;
- public void fl(){};//空构造方法
- public void fl(int age ,String name)
- {
- this.age=age;
- this.name=name;
- System.out.println("年龄"+age+",姓名"+name);
- } //有参构造方法
- abstract void met(); //抽象方法
- }
- //子类:
- class Zl extends Fl{
- public void met(){};
- //Zl a=new Zl();
- void getProperties()
- {
- this.fl(5,"ewlfj");
- }
- //Zl b=new Zl(5);
- }
- class Test
- {
- public static void main(String[] args)
- {
- Zl a=new Zl();
- a.getProperties();
- }
- }
复制代码 |