This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stack overflow error

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"why this program is not giving stack overflow error"

It does for me.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not giving ...
Please help ...
Thanks .
 
Jay Pawar
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic