没有使用递归如何抛出堆栈溢出异常? [英] Without using recursion how can a stack overflow exception be thrown?

查看:145
本文介绍了没有使用递归如何抛出堆栈溢出异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不使用递归如何抛出堆栈溢出异常?

Without using recursion how can a stack overflow exception be thrown?

推荐答案

如果调用足够的方法,堆栈溢出可以随时发生虽然,如果您在不使用递归的情况下获得堆栈溢出错误,则可能需要重新思考如何处理事情。这是递归的简单,因为在无限循环中,你调用了大量的方法。

If you call enough methods, a stack overflow can occur anytime. Although, if you get stack overflow errors without using recursion, you may want to rethink how you're doing things. It's just so easy with recursion because in an infinite loop, you call a ton of methods.

这篇关于没有使用递归如何抛出堆栈溢出异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆