class Example { static void Main(){ var myVar = "Hello World"; } }
编译器将根据隐式声明的赋值来判断类型。
匿名类型的局限性:
var a=2,b=3;//错误
匿名变量通常与linq查询相关。