How to create the instance of child class in C#?
class Parent
{
virtual void test()
{
Console.writeline("this is parent");
}
}
class Child : Parent
{
override void test()
{
Console.writeline("this is from child");
}
}
public static void main()
{
//Which one is right below?
Child ch = new Child();
Parent pa = new Parent();
ch = new Parent();
pa=new Child();
ch.test();
pa.test();
}