Why can't an object of abstract class be created?

前端 未结 16 982
误落风尘
误落风尘 2020-12-02 21:25

Here is a scenario in my mind and I have googled, Binged it a lot but got the answer like

\"Abstract class has not implemented method so, we cant create the object\

16条回答
  •  难免孤独
    2020-12-02 21:29

    Actually when we create an object of a normal class we use Constructor to allocate the memory for that object like

    myclass obj=new myclass();
    

    Here using constructorr clr identifies how much memory the object needed depending upon the instance variabless and methods. But in case of abstract classes we cant predict the amount of memory required as we dont implement the abstract methods so its not possible to create object.

提交回复
热议问题