Errors in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Errors in java

Whats exception in thread “main” java.lang.stackoverflow error means??and how can I get rid off this error?? https://code.sololearn.com/cpKdlRexk4nc/?ref=app So this is the code I am tryingt to write and the place where it says the error in ,where I try to defined rectangleframe.I really did not understand what is the problem???

21st May 2020, 9:28 PM
Begum
Begum - avatar
3 Answers
+ 3
You'll need to show the code associated with the error in order to resolve the issue. You can edit your post and attach a link to the code after saving it in the playground.
21st May 2020, 10:06 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
This exception occurs when you have a call stack which exceeds the allocated memory. A typical example provoking it are recursions which do not reach base cases. https://code.sololearn.com/cpy956sh6Paz/?ref=app Another root cause are event handlers invoking another event which then invokes the initial one again. Think of min and max, which correct each other (min=5, max=7 -> set max to 3 -> min=3, max=3). When you do not stop correcting on equal values you get a stack overflow.
21st May 2020, 10:08 PM
Manu_1-9-8-5
Manu_1-9-8-5 - avatar
0
if you use recursion, see condition how it can stop and returns before code run over its hw limitations
22nd May 2020, 4:52 AM
zemiak