Abstract class with all concrete methods

后端 未结 9 1325
感情败类
感情败类 2020-12-08 21:49

Are there some practical programming situations for someone to declare a class abstract when all the methods in it are concrete?

9条回答
  •  旧时难觅i
    2020-12-08 22:12

    Nice question :)

    One thing is for sure ... this is certainly possible. The template suggestion by krosenvold is one good reason for doing this.

    I just want to say that a class must not be declared abstract just for preventing it's instantiation.

    This is referred in the Java Language Specification Section 8.1.1.1

提交回复
热议问题