Why can't we create an instance of an abstract class?

前端 未结 7 2279
再見小時候
再見小時候 2021-01-04 13:29

I found in many places that :

  • An Abstract Class is a class which is supposed to be used as a base class.
  • An Abstract Class is a class which has atleas
7条回答
  •  梦毁少年i
    2021-01-04 13:36

    In abstract class no method definition is given, only structure is provided. If we could instantiate abstract class and call those method, it will be a huge mess. Abstract class is use to maintain a design pattern of the code.

提交回复
热议问题