My first question: What is the difference between an protected and a public constructor in an abstract class?
My second questions: Does it make sense, if the abstract cl
There doesn't seem to be much difference to me, the following code outputs
Foo
Bar
public abstract class Foo
{
protected Foo() {
Console.WriteLine ("Foo");
}
}
public class Bar : Foo
{
public Bar() {
Console.WriteLine ("Bar");
}
}
void Main()
{
new Bar();
}
An abstract constructor can not be overriden if it's protected. Not sure If I answered your question :-)