Groups | Blog | Home
all groups > asp.net > may 2005 >

asp.net : Friend & Protected keywords


Manohar Kamath
5/14/2005 8:38:00 PM
These are more of VB.NET keywords, than asp.net ones.

Friend == the object is accessible within the same assembly, class,
depending on where you declare.

Protected == The variables/objects declared with this are accessible within
the same class, or any derived class. This is the midway between public
(accessible by anyone) and private (accessible only within the class)

More on VB.net keywords:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vaorivblangkeywordsall.asp

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com


[quoted text, click to view]

dw
5/14/2005 9:14:40 PM
Hi, everyone. I'm having difficulty understanding the difference of the
keywords "friend" and "protected" vs. some of the other ways you can declare
variables in ASP.NET ("dim", "public", and "static"). Can someone provide an
example of where you'd use these keywords? Sorry for the newbie question.
Thanks.

dw
5/14/2005 10:30:25 PM
Thanks, Manohar. Now the keywords make sense.

[quoted text, click to view]

AddThis Social Bookmark Button