469,364 Members | 2,424 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,364 developers. It's quick & easy.

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 5140
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.