473,467 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

about delegate

Hello!

When I define a class the default access modifier is internal.

So if I just write
class MyTest
{
. . .
}
this definition has internal as access modifier

but if I define a delegate as
delegete returnType SomeName (someArgumentList);
Is it the same here that internal is the default access modifier if none is
given

//Tony
Nov 28 '07 #1
4 1645
Tony,

Yes, that is the case.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tony Johansson" <jo*****************@telia.comwrote in message
news:Fz***************@newsb.telia.net...
Hello!

When I define a class the default access modifier is internal.

So if I just write
class MyTest
{
. . .
}
this definition has internal as access modifier

but if I define a delegate as
delegete returnType SomeName (someArgumentList);
Is it the same here that internal is the default access modifier if none
is given

//Tony

Nov 28 '07 #2
Tony Johansson <jo*****************@telia.comwrote:
this definition has internal as access modifier

but if I define a delegate as
delegete returnType SomeName (someArgumentList);
Is it the same here that internal is the default access modifier if none is
given
If it's declared outside another type, that's true.
If it's declared within another type, it's private by default. (The
same is true for other types too.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Nov 28 '07 #3
Hello!

When I write this delegete returnType SomeName (someArgumentList);
I call it to define a delegate but you call it to declare.
In C++ it was a big difference between define a class and to declare a
class.

In my exemple here with the delegate I assume you agree with me
that to define and declare is the same.

It's just a matter of taste.

//Tony

"Jon Skeet [C# MVP]" <sk***@pobox.comskrev i meddelandet
news:MP********************@msnews.microsoft.com.. .
Tony Johansson <jo*****************@telia.comwrote:
>this definition has internal as access modifier

but if I define a delegate as
delegete returnType SomeName (someArgumentList);
Is it the same here that internal is the default access modifier if none
is
given

If it's declared outside another type, that's true.
If it's declared within another type, it's private by default. (The
same is true for other types too.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Nov 28 '07 #4
Tony Johansson <jo*****************@telia.comwrote:
When I write this delegete returnType SomeName (someArgumentList);
I call it to define a delegate but you call it to declare.
Well, it's declaring a delegate type.
In C++ it was a big difference between define a class and to declare a
class.

In my exemple here with the delegate I assume you agree with me
that to define and declare is the same.
Well, it depends what you use "declare" and "define" to mean. I tend to
use "declaration" because that's what the spec does. For instance:

"A delegate-declaration is a type-declaration (§9.6) that declares a
new delegate type."

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Nov 29 '07 #5

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

Similar topics

6
by: Flare | last post by:
Hi i have a qusstion about events and delegates. Especially the precis role of the Event. Eg. We have a class wich want to fire events so we declare: public delegate void...
2
by: Max Adams | last post by:
Question about using delegates with a string paramater to return a ListViewItem object... All, I have a thread and I want this thread to post messages to the main GUI thread using a delegate....
3
by: Minh Khoa | last post by:
Please give me more information about delegate and its usage? Why do i use it and when?
12
by: Michael S | last post by:
Why do people spend so much time writing complex generic types? for fun? to learn? for use? I think of generics like I do about operator overloading. Great to have as a language-feature, as...
1
by: Quimbly | last post by:
I'm having some problems comparing delegates. In all sample projects I create, I can't get the problem to occur, but there is definitely a problem with my production code. I can't give all the...
1
by: Morgan Cheng | last post by:
Asynchronous method model generally has a callback delegate as argument. The delegate will be called when some WaitHandle is set or time out. And, one more argument is used as state object to...
4
by: Frankie | last post by:
The following questions are with respect to this delegate declaration: delegate void MyDelegate(string s); Question 1: Why does the following NOT work? Why can't I just create a new instance...
6
by: jmDesktop | last post by:
In a function that takes another function (function pointer) as a argument, or the callback function, which is the one that "calls back"? I'm having a hard time understanding the language. Am I...
8
by: Magnus.Moraberg | last post by:
Hi, Lets say I have a class called Point and I give this class the following properties - int CoordinatesInPixels{...} float CoordinatesInInches{...} And the Method -
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.