Quiz #2
Look at the following snippet:
public class Foo { protected Foo() {} } public class Var : Foo { Var(): base() {} void Main() { Foo foo = new Foo(); } }
Now tell me if it can be successfully compiled:
- both in 1.1 and 2.0
- only in 1.1
- only in 2.0
- neither in 1.1 nor in 2.0












Well I’m new to .NET – coming from Microsoft Navision development – but I figure a class with a Main method is supposed to be static, shouldn’t it? Otherwise there would be multiple entry points via instantiation. So I think it’s not supposed to be compiled with anything.
No Miklos (not sure if this is your name or if Hollender is), the fact that usually a static method named “Main” is the entry point for an application is only the Visual Studio default behavior.
The fact I called that method “Main” is not related to the response.
Sorry not to have replied before, I have some troubles with comments notification.