In case 1, the MessageBox is a static class, it has no constructors (update - it has a private constructor reflecting a reflector, but the OP gave an incorrect compiler error message). Static classes are defined as follows:
public static class MessageBox { }
A static class can only have static methods and as such should not be created.
In case 2, MyClass is not a static class, and the compiler generates a default constructor for you if you do not define any constructors.
UPDATE: for all downvoters: compile the project with a static class and examine it in the reflector - it decompiles without a static keyword, because for a static class there is no MSIL or metadata; the compiler (in .net 2.0 or later) generates an abstract private class without constructors. The keyword "static" is just syntactic sugar. Also, in 1.0 / 1.1 of .NET (when the MessageBox was created), the static keyword did not exist for classes, and the closed / closed ctor was the accepted pattern.
x0n
source share