Results 1 to 2 of 2

Thread: [2005] Concept of a constructor

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Location
    Surabaya, Indonesia
    Posts
    163

    [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
    Check my Blog at VB Corner,Component Crafts

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    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
  •  



Click Here to Expand Forum to Full Width