Blog

Output of following code:

abstract class Fruit {
protected String color =”PINK”;
protected abstract String Color() { throw new NotImplementedException(); }
}

class Apple : Fruit {
protected override string Color() {
return this.color;
}
}

class Program {
static void Main(string[] args) {
Fruit f = new Apple();
try
{
Console.WriteLine(f.Color());
}
catch (Exception e)
{
throw e.InnerException;
}
}
}