Outline
An abstract class may not contain abstract methods,
as long as an abstract method where the class is abstract, you can.
Such a method is not an abstract class is abstract and can not create object directly, there use in some special scenarios.
Sample Code
//父类
public abstract class Fu {
public Fu() {
System.out.println("抽象父类构造方法执行!");
}
public abstract void eat();
}
//子类
public class Zi extends Fu {
public Zi() {
// super();
System.out.println("子类构造方法执行");
}
//子类必须重写抽象父类的抽象方法,除非子类也是抽象类
@Override
public void eat() {
System.out.println("吃饭饭");
}
}