This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes StackOverFlow Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "StackOverFlow Exception" Watch "StackOverFlow Exception" New topic
Author

StackOverFlow Exception

kieran pattni
Ranch Hand

Joined: Jan 19, 2004
Posts: 47
hi all...can anyone tell me what stackoverflow exception means in the "main" means.. thank you
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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."


[Jess in Action][AskingGoodQuestions]
kieran pattni
Ranch Hand

Joined: Jan 19, 2004
Posts: 47
hi again...hope isnt stupid question..but how do i exactly stop StackOverflowexception in main happening ?...thanks
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
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).


Tony Morris
Java Q&A (FAQ, Trivia)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: StackOverFlow Exception
 
Similar Threads
stackoverflow cloning hashtable
PowerMock: StackOverFlow
recursive JSF action
Pattern Matching
constructor doubt