|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
about delegateHello!
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 Tony,
Yes, that is the case. -- Show quote- Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com "Tony Johansson" <johansson.anders***@telia.com> wrote in message news:Fzi3j.956$R_4.712@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 > Tony Johansson <johansson.anders***@telia.com> wrote:
> this definition has internal as access modifier If it's declared outside another type, that's true.> > 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 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 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 Show quote "Jon Skeet [C# MVP]" <sk***@pobox.com> skrev i meddelandet news:MPG.21b7d07f1caef6a677@msnews.microsoft.com... > Tony Johansson <johansson.anders***@telia.com> wrote: >> 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 Tony Johansson <johansson.anders***@telia.com> wrote:
> When I write this delegete returnType SomeName (someArgumentList); Well, it's declaring a delegate type.> 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 Well, it depends what you use "declare" and "define" to mean. I tend to > class. > > In my exemple here with the delegate I assume you agree with me > that to define and declare is the same. 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 |
|||||||||||||||||||||||