472,139 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 software developers and data experts.

Public, Private, Protected? Thanks.

Hello,

What is the difference of using:

Sub function()
Public Sub function()
Private Sub function()
Protected Sub function()

I place all my functions in my aspx.vb files but I have some problems
when deciding when to use Public, Private, Protected or none.

Thank You,
Miguel
Nov 19 '05 #1
3 5257
Public == Available to everyone who can access the class
Private == Available only within the class where the function/variable is
declared
protected = Available only within the class, or any class that is derived
from the class

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Hello,

What is the difference of using:

Sub function()
Public Sub function()
Private Sub function()
Protected Sub function()

I place all my functions in my aspx.vb files but I have some problems when
deciding when to use Public, Private, Protected or none.

Thank You,
Miguel

Nov 19 '05 #2
Miguel,

I personally think it's ok to ask any questions. But for your own benefit
grab one of these books teaching programming and read it.

Eliyahu

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Hello,

What is the difference of using:

Sub function()
Public Sub function()
Private Sub function()
Protected Sub function()

I place all my functions in my aspx.vb files but I have some problems
when deciding when to use Public, Private, Protected or none.

Thank You,
Miguel

Nov 19 '05 #3
I recommend the "Class Design Handbook" by WROX. There is a C# and a Visual
Basic.NET edition.
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Hello,

What is the difference of using:

Sub function()
Public Sub function()
Private Sub function()
Protected Sub function()

I place all my functions in my aspx.vb files but I have some problems when
deciding when to use Public, Private, Protected or none.

Thank You,
Miguel

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Adam H. Peterson | last post: by
10 posts views Thread by darrel | last post: by
4 posts views Thread by louise raisbeck | last post: by
8 posts views Thread by Jordan | last post: by
5 posts views Thread by Paul | last post: by
86 posts views Thread by jopperdepopper | last post: by
9 posts views Thread by Gilbert | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.