Monday, April 23, 2018

Can we create the object of an abstract class ?

  1. abstract public class MyAbstractExe {
  2. MyAbstractExe exe = new MyAbstractExe();
  3. }

No ! we can not create the object / instance of an abstract class. Compiler will give an error at line 2 saying cannot instantiate the type MyAbstractExe 

No comments:

Post a Comment

Blueprint for self-improvement

To learn faster: Make the process fun To understand yourself : Write To understand the world better : Read To build deeper connection : Lis...