我在C#中编写了一些代码,我发现自己写了:
return new MyClass(...
Run Code Online (Sandbox Code Playgroud)
当我注意到,这两个return和new都是C#关键字.所以我想知道C#中最长的关键字合法序列是什么.我能想到的只有:
internal static override void MyFunc(...
Run Code Online (Sandbox Code Playgroud)
internal static override void所有关键字在哪里?你能想到更长的关键词序列吗?
注意:这个问题确实没有意义.我只是希望在火上浇一些乐趣:-)
Mar*_*ell 47
对于6:
new protected internal unsafe virtual decimal Foo() {...}
Run Code Online (Sandbox Code Playgroud)
编辑7:
new protected internal unsafe virtual extern decimal Foo();
Run Code Online (Sandbox Code Playgroud)
如果我们允许括号和括号......
(编辑 "锁定","新对象()","as"和"字符串"由其他人提供;见评论)
decimal Bar() {
lock (new object() as string) {
if (true) {
checked {
unsafe {
try {
do {
return default(decimal);
unchecked {break;}
continue;
} while (false);
}
catch { throw; }
finally { }
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
Nik*_*iki 36
我想这是无限的:
return null as string as string as string as string as string....
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1859 次 |
| 最近记录: |