Why cannot an implicitly typed variable be declared at class level?
为什么不能一个隐式类型变量被声明在类级别吗?
The syntax of array creation expressions (§7.5.10.2) is extended to support implicitly typed array creation expressions.
扩展数组创建表达式(§7.5.10.2)的语法用以支持隐型数组创建表达式。
When you create an anonymous type that contains an array, the array must be implicitly typed in the type's object initializer.
建立包含阵列的匿名型别时,在型别的物件初始设定式中阵列必须是隐含型别。
Finally, we need implicitly typed variables, so that we can assign the query to a variable without having to declare its type explicitly.
最后,我们需要使用隐式类型化变量,这样就可以为变量分配查询,不必显式声明其类型。
Implicitly typed local variables, which permit the type of local variables to be inferred from the expressions used to initialize them.
隐型局部变量,允许局部变量的类型从初始化它们的表达式推导而来。
Implicitly typed arrays, a form of array creation and initialization that infers the element type of the array from an array initializer.
数组创建和初始化的形式,它从数组初始化器推导出数组的元素类型。
Also as the name says, implicitly typed local variable, you cannot use var for field declaration or constant variables, therefore following declarations will both produce a compiler error.
故名思意,“隐式类型局部变量”将无法用于域变量或常量的声明中,否则将导致编译错误。
The rules for any implicitly-typed variable also apply to implicitly-typed arrays.
任何隐含型别变数的规则都适用于隐含型别阵列。
If the range variable is explicitly typed, make sure that the type is either the same as, or implicitly convertible from, the type of the elements in the collection it iterates.
如果范围变量是显式类型的,请确保该类型与循环访问的集合中的元素类型相同或可从该类型隐式转换。
You can create an implicitly-typed array in which the type of the array instance is inferred from the elements specified in the array initializer.
您可以建立隐含型别的阵列,在其中阵列执行个体的型别是由阵列初始设定式中指定的项目推断。
Implicitly-typed arrays are usually used in query expressions together with anonymous types and object and collection initializers.
隐含型别阵列通常是在查询运算式中与匿名型别及物件和集合初始设定式一起使用。
In the previous example, notice that with implicitly-typed arrays, no square brackets are used on the left side of the initialization statement.
请注意,在上一个示例中,没有在初始化语句的左侧对隐式类型的数组使用方括号。
In the previous example, notice that with implicitly-typed arrays, no square brackets are used on the left side of the initialization statement.
请注意,在上一个示例中,没有在初始化语句的左侧对隐式类型的数组使用方括号。
应用推荐