父类:
package imooc;
public abstract class Shape {
public abstract void a();
public abstract void b();
}
子类
package imooc;
public abstract class Mea extends Shape {
@Override
public void a() {
// TODO Auto-generated method stub
System.out.println("22");
}
@Override
public void b() {
// TODO Auto-generated method stub
System.out.println("ss");
}
}
测试:
package imooc;
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
Shape rr=new Mea();
}
}
这个没错的。你用测试类运行一变,那个红叉就消失了!
复制了你的代码,事实证明没问题