Re: learn C++ or C#
Arne Vajhøj wrote:
The phrase "static class" appears in the source code... the use of the
keyword 'static' in that context is already taken.
Arne Vajhøj wrote:
Ben Voigt [C++ MVP] wrote:
>>
>Java and C# use the term "static class" in totally different ways. In C#,
>a nested class definition provides privileged access to
>private members of the parent when properly addressed using a parent
>reference, and to generic argument of the parent, but not an
>instance of the parent. In Java, a nested class definition creates
>an "inner class" which is bound to an instance of the parent, sort
>of like the closure that C# uses for anonymous methods. In Java,
>"static class" is used to create a nested class that isn't also an
>"inner class".
>
I don't think anyone in the discussion was thinking about Java
"static nested class" or "static member class".
>
They are practically never referenced as just "static class".
>>>static classes - missing
>>I don't understand this. Are you saying that C# didn't get to use
>>"static" when declaring a class until 2.0? That doesn't sound right
>>to me. I'm also not clear on what you mean by "missing" with
>>respect to Java, since you can effectively create a static class in
>>Java just as easily in C#.
>>>
>>I must be misunderstandin g what you mean by "static
>>classes"...pl ease elaborate.
>>I don't understand this. Are you saying that C# didn't get to use
>>"static" when declaring a class until 2.0? That doesn't sound right
>>to me. I'm also not clear on what you mean by "missing" with
>>respect to Java, since you can effectively create a static class in
>>Java just as easily in C#.
>>>
>>I must be misunderstandin g what you mean by "static
>>classes"...pl ease elaborate.
>Java and C# use the term "static class" in totally different ways. In C#,
>a nested class definition provides privileged access to
>private members of the parent when properly addressed using a parent
>reference, and to generic argument of the parent, but not an
>instance of the parent. In Java, a nested class definition creates
>an "inner class" which is bound to an instance of the parent, sort
>of like the closure that C# uses for anonymous methods. In Java,
>"static class" is used to create a nested class that isn't also an
>"inner class".
I don't think anyone in the discussion was thinking about Java
"static nested class" or "static member class".
>
They are practically never referenced as just "static class".
keyword 'static' in that context is already taken.
>
Arne
Arne
Comment