Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

StackOverFlow Exception  RSS feed

 
kieran pattni
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all...can anyone tell me what stackoverflow exception means in the "main" means.. thank you
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally you get this if a function directly or indirectly calls itself, forever; eventually the JVM runs out of space on the "program stack" to hold the return addresses for all those function calls; this is called a "stack overflow."
 
kieran pattni
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi again...hope isnt stupid question..but how do i exactly stop StackOverflowexception in main happening ?...thanks
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It (almost always) means you have made a recursive call (directly or indirectly) that has no base case - and so never ends (until the stack overflows of course).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!