How to create objects for abstract class in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to create objects for abstract class in java?

19th May 2018, 2:24 PM
Ankit Pal
Ankit Pal - avatar
1 Answer
+ 3
The only way is to extend the abstract class to another class and create an object from the subclass, for example... abstract class A {} class B extends A {} A a = new B();
19th May 2018, 5:07 PM
Elmer Martens
Elmer Martens - avatar