This program throws an exception at runtime. If you've been burned by this problem before, you'll know what's wrong before you even see the definition for class Bar...
using System;
class Program
{
static void Main()
{
Foo foo = new Bar();
}
}
abstract class Foo
{
public Foo()
{
Init();
}
protected abstract void Init();
}
class Bar : Foo
{
string message;
public Bar()
{
message = "Hello!";
}
protected override void Init()
{
Console.WriteLine(message.ToUpper());
}
}