当地的课程 [英] local classes
问题描述
我注意到C#不支持本地类。你可以请
讨论为什么会这样吗?这是一个糟糕的编码实践吗?
8月29日下午4:15,PGP < priyesh_do_not_replywrote:
我注意到C#不支持本地类。你可以请
讨论为什么会这样吗?这是一个糟糕的编码实践开始吗?
本地类究竟是什么意思?你在谈论Java拥有的
匿名内部类吗?他们通常会处理需求
,这可以通过C#中的代表更好地解决。
Jon
>
>
本地类究竟是什么意思?你在谈论Java拥有的
匿名内部类吗?他们通常会处理需求
,这可以通过C#中的代表更好地解决。
Jon
不确定Java。在C ++中,它们是可以在
函数中定义的类。
<"""""" PGP" < priyesh_do_not_reply>写道:
不确定Java。在C ++中,它们是可以在
函数中定义的类。
他们有什么用?如果你能说出你通常尝试用它们实现的价值,我们可以解释你在同样的情况下会做什么
$ C $ b在C#中。
-
Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet 博客: http://www.msmvps.com/jon.skeet
如果回复该群组,请不要给我发邮件
I notice that local classes are not supported in C#. Could you please
discuss why this is so? Was this a bad coding practice to begin with?
On Aug 29, 4:15 pm, "PGP" <priyesh_do_not_replywrote:I notice that local classes are not supported in C#. Could you please
discuss why this is so? Was this a bad coding practice to begin with?What exactly do you mean by "local classes"? Are you talking about the
anonymous inner classes that Java has? They usually tackle a need
which is better addressed with delegates in C#.
Jon
>What exactly do you mean by "local classes"? Are you talking about the
anonymous inner classes that Java has? They usually tackle a need
which is better addressed with delegates in C#.
Jon
Not sure about Java. In C++, they are classes that can be defined within
functions.
<"PGP" <priyesh_do_not_reply>wrote:Not sure about Java. In C++, they are classes that can be defined within
functions.And what use are they? If you could say what you normally try to
achieve with them, we can explain what you''d do in the same situation
in C#.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
这篇关于当地的课程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!