473,395 Members | 1,670 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Friend & Protected keywords

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.
Nov 19 '05 #1
2 1814
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" <co***************@uncw.edu> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
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.

Nov 19 '05 #2
dw
Thanks, Manohar. Now the keywords make sense.

"Manohar Kamath" <mk*****@REMOVETHISkamath.com> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
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" <co***************@uncw.edu> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
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.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Samee Zahur | last post by:
Question: How do friend functions and static member functions differ in terms of functionality? I mean, neither necessarily needs an object of the class to be created before they are called and...
8
by: Carlos J. Quintero | last post by:
Hi, As you know the current keywords "protected internal" (C#) or "Protected Friend" (VB.Net) means "Protected Or internal" (C#) or "Protected Or Friend" (VB.Net), that is, the member is...
7
by: Steve | last post by:
I'm just curious, why did give VB.Net a Friend keyword but not C#?
7
by: Jesper | last post by:
I need to grant a class access to protected fields of another class in the way its possible in C++ with the friend keyword. However I would like to keep the class protected towards other class...
5
by: | last post by:
hello there, what is the difference between Shared and Protected Shared? where can I read more about theses kind of variables (or whatever they are....sorry, don't know the word in eng.) ...
7
by: c#2006user | last post by:
Hi everyone. i know there is a lot of code and ive reduced it as much as i could, its a bit much to ask but i am really stuck! i've been at this for a week! this is converted from vb to c# and...
2
by: freegnu | last post by:
how to declare a friend function that can access two class it will look like the following class A { private: int i; public: A(){} ~A(){} friend void call(A &a, B &b);
3
by: Neal | last post by:
Hi all Why do I get a compiler error with the following code. Friend Class SomeClass End Class Public Class SomePublicClass Protected Friend Function AMethod As SomeClass
3
by: tonvandenheuvel | last post by:
Hi all, the following code does not compile in gcc 4.0.2: 3 class Outer 4 { 5 class B; 6 7 template<typename T>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.