Possible Duplicate:
What is System.Void?
Why not System.Void?
I noticed that it is not allowed to use typeof(System.Void). But typeof(void) is allowed.
When you use typeof(System.String) or typeof(string) there is no difference.
Why is this the case?
This is because C# defines aliases to keep the original C flavor.
The .NET Framework uses specific naming conventions: for instance it states that a class name should start with a Capital. Therefore,
String— which is not a C# native type but a .NET class defined in theSystemnamespace — is actually calledSystem.String, orStringfor short if you have ausing System;in your file.C# defines
stringas an alias ofSystem.Stringso that code can look like it does in C and other C-based languages (C++, Java, …). I think it’s more readable. In the same fashion,intis the same asSystem.Int32.