+ 2
Can we create a reference of abstract class?
An abstract class being a super-class can we use it to create a reference of super-class and an object of sub-class while instantiation or while passing an object of sub-class as a parameter and receive it in a method with a reference of that abstract super-class?
1 Resposta
+ 37
We can. Like this :
ConcreteClass extends AbstractClass {...}
AbstractClass a = new ConcreteClass();