I am getting following error: Cannot create an instance of the abstract class or interface
My Assignment code is as under.
class Class1
{
static void Main(string[] args)
{
Foo foo = new Foo();
Console.ReadLine();
}
}
abstract class Foo
{
public Foo()
{
Console.WriteLine("In Foo");
}
}
class Bar : Foo
{
public Bar()
{
Console.WriteLine("In Bar");
}
}
//Output
//Error: Cannot create an instance of the abstract class or interface 'TestCmd.Foo'