Why we cannot create object of abstract class. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why we cannot create object of abstract class.

22nd Nov 2017, 4:19 PM
Arpit Srivastava
Arpit Srivastava - avatar
4 Answers
+ 14
Because an abstract class is an incomplete class (incomplete in the sense it contains abstract methods without body and output.) We cannot create an instance or object, the same way you say for an interface.
22nd Nov 2017, 4:31 PM
Dev
Dev - avatar
+ 8
Just think about who decides if a class is abstract? So you want the class not to be instantiated.. directly.
22nd Nov 2017, 4:41 PM
AZTECCO
AZTECCO - avatar
+ 1
abstract class doesn't contain all abstract method there may be some non abstract methods which can be implemented.
22nd Nov 2017, 4:35 PM
Arpit Srivastava
Arpit Srivastava - avatar
+ 1
As abstract class is a class which is defined with abstract keyword i.e.,a class which is meant not to be instantiated is by the programmer or any of its method's implementation is not known. So, what's the use of creating an instance of a class not having everything properly defined. This is the reason abstract class is not instantiated.
10th May 2018, 5:49 AM
Jyoti Mishra