Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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?
Posted
Updated 19-Dec-10 19:21pm
v2
Comments
JF2015 20-Dec-10 1:24am    
Edited to fix code formatting.
Abhinav S 20-Dec-10 1:29am    
You need to provide more information to help someone figure out what the problem could be.
However, by the look of things there is something indide one of SMSDL or SMSBO classes that is causing some sort of an endless recursive code to run.
Sandeep Mewara 20-Dec-10 1:30am    
1. You need to be clear on what Stack overflow error is
2. There must be more in your project leading to it(recurrsive instantiation) then just this class.

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900