Friend & Protected keywords

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.
 
M

Manohar Kamath

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
 
D

dw

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top