|
by luisabreu via LA.NET [EN] on 7/15/2010 7:48:42 PM
After the last two posts, I guess you could see this coming, right? Today it’s all about type constructors (and it’s a long post, so make sure you’re comfy). What is a type constructor (aka, class constructor)? In C#, it’s a static and private parameterless method which is named after the class where it’s defined. Here’s a small example: class MyClass {
static MyClass() {
//initialize static fields here
}
}
Type constructors must be private (in fact, in C# you can’t even use
... [ read more ]
|
|