What is abstract | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is abstract

Abstract class

30th Mar 2017, 6:07 PM
Vishal Agrawal
Vishal Agrawal - avatar
2 Answers
+ 3
An abstract class cannot be instantiated (to create a new instance of the class). Basically an abstract class has a protected constructor that cannot be directly accessed the way i did in the example. ex/ public abstract class example{} public class main(){ public static void main(String args[]){ example notAllowed = new example(); // this is illegal } }
30th Mar 2017, 6:22 PM
Rrestoring faith
Rrestoring faith - avatar
+ 2
that can have abstract methods and normal methods.
30th Mar 2017, 7:21 PM
Meharban Singh
Meharban Singh - avatar