这里我还偷偷使用了另一个特性——隐式类型局部变量(implicitly typed local variables),它使用var上下文关键字声明。编译器可以根据该变量的初始值推断其类型。
基于8个网页-相关网页
隐式类型局部变量
Implicit type local variable
以上为机器翻译结果,长、整句建议使用 人工翻译 。
故名思意,“隐式类型局部变量”将无法用于域变量或常量的声明中,否则将导致编译错误。
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.
youdao
应用推荐
模块上移
模块下移
不移动