如何防止堆栈溢出异常 [英] How to prevent stack overflow exception

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

问题描述

public class SMSBL
{
    SMSDL dlayer = new SMSDL();
  
    SMSBO player = new SMSBO();
}



当类获得负载时,我得到了有关上述类中声明的堆栈溢出异常.



When the class gets loads, I''m getting an exception of stack overflow regarding declarations in the above class.
How to prevent stack overflow exception?

推荐答案

嗨...

最好共享有关类实现的更多详细信息.

乍看之下,似乎是由于永无止境的递归而发生的问题.检查您是否具有相互依赖的类,并且它们在其构造函数中正在相互初始化.

谢谢和问候,
斯坦·兰帕里亚(Chetan Ranpariya)
Hi...

It''s better if you can share some more details about your class implementation.

At first glance it looks like the problem occurring because of never ending recursion. Check if you have classes which have dependencies on each other and they are initializing each other in their constructors.

Thanks and regards,
Chetan Ranpariya


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

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