I have abstract class and normal class. The normal class inherited from abstract class.
see below
public abstract class ABParent
{
public void Add()
{
}
}
public class Derived : ABParent
{
public void Show()
{
}
}
Here abstract class can't be instantiated. In other words, we can't create object for abstract class.
See below code
ABParent objABParent = new Derived();
From above code, objABParent
is act like instance of abstract class and we can only access all elements in abstract class by using objABParent
.
So my doubt is how it work as instance of abstract class?