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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Private vs Public Function 1

Status
Not open for further replies.

jalbao

Programmer
Nov 27, 2000
413
0
0
US
Can someone explain the difference between a Public Function and a Private Function.

I'm especially curious about how to determine which type of function to use.

tia
 
The difference is the scope of the object. A public object is accessible outside of the context in which it is declared - a private object is obviously the opposite, its not accessible outside the context in which it is declared. Basically if you want to access your function from another class call it public, if you only want it available within the class call it private.
Try reading an introductory book about .NET it will explain these concepts more completely and is easier to leverage than the help documentation if you are learning some general ideas.
 
I don't mean this to be anything but help. You can download the first five chapters of a good starting point for people who do not understand .Net from
An introduction to Visual Basic .NET for adults (has some invaluable information written in plain language)It will help you understand Scope.

Rattlemouth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top