|
-
May 1st, 2007, 10:03 PM
#1
Thread Starter
Addicted Member
[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
-
May 1st, 2007, 10:12 PM
#2
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.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|