Having such class can I instatiate it in place?
abstract class Mammal {
public abstract void Foo();
}
I expect that something like that should work:
Mammal wolf = new Mammal() {
public void Foo() { Console.WriteLine("Wooo"); }
}
However compilier doesn’t allow that.
It looks like you’re after something akin to an anonymous inner class in Java. There’s no equivalent in C#. Options: