如何用几行代码产生StackOverflowException?
如何用最少的代码行生成 StackOverflowException
?
How can I produce a StackOverflowException
with minimal lines of code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
作弊,我知道...:)
Cheating, I know... :)
像这样:
Like this:
不是最短的,但很有趣:)
Not the shortest one but funny:)
我总是使用这个代码(因为它更难检测):-(
I always use this code (because it is harder to detect) :-(
在伪代码中
in pseudocode
我认为这应该有效。一般来说,任何不终止的递归。
I think this should work. In general, any recursion that doesn't terminate.
运行此代码(递归):
Run this code (recursion):