为什么不能一个隐式类型变量被声明在类级别吗?
Why cannot an implicitly typed variable be declared at class level?
故名思意,“隐式类型局部变量”将无法用于域变量或常量的声明中,否则将导致编译错误。
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.
最后,我们需要使用隐式类型化变量,这样就可以为变量分配查询,不必显式声明其类型。
Finally, we need implicitly typed variables, so that we can assign the query to a variable without having to declare its type explicitly.
应用推荐