Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Friend & Protected keywords

Reply
Thread Tools

Friend & Protected keywords

 
 
dw
Guest
Posts: n/a
 
      05-15-2005
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.


 
Reply With Quote
 
 
 
 
Manohar Kamath
Guest
Posts: n/a
 
      05-15-2005
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/de...eywordsall.asp

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


"dw" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
 
dw
Guest
Posts: n/a
 
      05-15-2005
Thanks, Manohar. Now the keywords make sense.

"Manohar Kamath" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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/de...eywordsall.asp
>
> --
> Manohar Kamath
> Editor, .netBooks
> www.dotnetbooks.com
>
>
> "dw" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
friend function accessing protected members of base class Rahul C++ 1 04-07-2008 01:04 PM
Protected member friend MiG C++ 12 08-12-2007 05:16 AM
shared? protected? friend? ASP .Net 5 11-29-2004 02:58 PM
Difference between "Protected WithEvents myClassName" And "Protected myClassName" ? Andreas Klemt ASP .Net 2 07-05-2003 12:51 AM



Advertisments