Java final abstract class

后端 未结 9 1945
情歌与酒
情歌与酒 2021-02-02 06:26

I have a quite simple question:

I want to have a Java Class, which provides one public static method, which does something. This is just for encapsulating purposes (to h

9条回答
  •  独厮守ぢ
    2021-02-02 07:11

    This is very simple explanation in plain English.An abstract class cannot be instantiated and can only be extended.A final class cannot be extended.Now if you create an abstract class as a final class, how do you think you're gonna ever use that class, and what is,in reality, the rationale to put yourself in such a trap in the first place?

提交回复
热议问题