var关键字运行时或编译时?关键字、var

2023-09-02 01:59:42 作者:滥情少女

var关键字得到的运行时类型或编译时?

var keyword gets the type at the runtime or compile time?

或依赖?

推荐答案

简单明了:编译时间

VAR 不是一个类型。实际的类型是想通了,在编译时。

var isn't a type. The actual type is figured out at compile-time.

VAR 变量也被称为隐式类型局部变量(C#编程指南)