[2005] Concept of a constructor
Sometimes, when I studying a component, I noticed that it has 2 constructor (usually with C# component)
- Static MyComponent()
- Public MyComponent()
That's mean in VB, it has Shared contructor and Public constructor right? I don't have any idea why you need a Shared constructor and what are they use for? Can somebody explain this to me ?
Thanks
Michael
Re: [2005] Concept of a constructor
Well, a shared member would be the same for all instances of the object, so it can't have any function for a specific instance. Therefore, I would think that the purpose of a shared constructor would be to initialize shared properties, since those are the only properties that a shared member would be able to work with.