概述:
    在初始化的时候根据初始化列表自动产生类型的一种机制。
实例代码:    
匿名类型(Anonymouse Type)      public static void Main()
          }

现在我们看一下,编译后的中间语言。

匿名类型(Anonymouse Type).method public hidebysig static void  Main() cil managed
 end of method NewTest::Main
由此可见,在编译的时候确实已经已经根据列表中的值确定了其类型。
运行结果:
2
4
this is a string

相关文章:

  • 2021-07-18
  • 2022-12-23
  • 2022-03-11
  • 2021-11-23
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-01-18
  • 2021-09-19
相关资源
相似解决方案