What is the longest legal statement block you can make with only C# keywords?

后端 未结 8 1440
粉色の甜心
粉色の甜心 2020-12-28 16:39

I was writing some code in C#, and I found myself writing:

return new MyClass(...

when I noticed that both the return and the

8条回答
  •  盖世英雄少女心
    2020-12-28 17:20

    Can I cheat?

    internal protected static volatile StringBuilder @string = 
      new StringBuilder(int.Parse("12"));
    

    Using the fact that I can use a keyword or other reserved term as a variable name if I prepend it with an @ - comes in at 9 if you allow the duplication of StringBuilder.

提交回复
热议问题