What is the main advantage of making a class abstract

前端 未结 9 571
渐次进展
渐次进展 2020-12-21 06:47

Why do we declare a class as abstract? I know it cannot be instantiated, but why give a special keyword for it. Even a \'normal\' class will work just as well and can be eas

9条回答
  •  生来不讨喜
    2020-12-21 07:20

    In abstract class you can implement some method and can make some abstract all your client will have to implement it also. you can provide some common functionality , also you can have some inherited fields and some of the skeleton method here

提交回复
热议问题