Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Private Constructor (Sub New)

Status
Not open for further replies.

cyranoses

Programmer
Jul 29, 2003
10
0
0
US
This is an under-the-hood question:
If I have a Public Class with a Private Constructor and a Public Method:
Public Class A
Private Sub New()
Public Sub DoSomething()

I can't implicitly create an instance of Class A from another class called B ( ie Dim a as New Class A) but I can use this line: A.DoSomething()

When Class B calls A.DoSomething() it doesn't create or own a copy of A but A does get created somewhere doesn't it? Else how can A run so that it can DoSomething?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top