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

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

问题描述

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

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天全站免登陆