Friend & Protected keywords

  • Thread starter Thread starter dw
  • Start date Start date
D

dw

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.
 
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/d...y/en-us/vblr7/html/vaorivblangkeywordsall.asp
 
Thanks, Manohar. Now the keywords make sense.

Manohar Kamath said:
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/d...y/en-us/vblr7/html/vaorivblangkeywordsall.asp
 
Back
Top