This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes stack overflow error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "stack overflow error" Watch "stack overflow error" New topic
Author

stack overflow error

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
public class MyFirst {

MyFirst m = new MyFirst();

public static void main(String[] args) {
MyFirst m = new MyFirst();
}

}

why this program is not giving stack overflow error ... i am thinking it as a chaining program ...

please help .
thanks .
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
"why this program is not giving stack overflow error"

It does for me.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Not giving ...
Please help ...
Thanks .
Jay Pawar
Ranch Hand

Joined: Aug 27, 2004
Posts: 411
Originally posted by rathi ji:
Not giving ...
Please help ...
Thanks .


It does for me too . I am using j2sdk1.4.2_05. What is yours ?


Cheers,<br />Jay<br /> <br />(SCJP 1.4)<br />Heights of great men were not achieved in one day, they were toiling day and night while their companions slept.
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
[Rathi]Not giving ...
Please help ...


What did you get when executing that piece of code?

Here's the result I got in JDK1.5:



The following code will too cause a StackOverflowError:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: stack overflow error
 
Similar Threads
Two simpe methods calling each other not working as expected
StackOverflowException
Class Path error Help
please help me to resolve this
not leading to stack overflow error