VAR在C#中 - 为什么不能将其作为一个成员变量?将其、作为一个、变量、成员

由网友(動次大次,動次大次)分享简介:为什么不能在C#中的类级时,这些变量将立即分配给具有隐式类型的变量? Why is it not possible to have implicitly-typed variables at a class level within C# for when these variables are immediatel...

为什么不能在C#中的类级时,这些变量将立即分配给具有隐式类型的变量?

Why is it not possible to have implicitly-typed variables at a class level within C# for when these variables are immediately assigned?

例如:

public class TheClass
{
    private var aList = new List<string>();
}

难道尚未实施或有一个概念/技术原因,为什么没有这样做?

Is it just something that hasn't been implemented or is there a conceptual/technical reason for why it hasn't been done?

推荐答案

的下面是埃里克的博客帖子,解释的理由。

阅读全文

相关推荐

最新文章