aspose file tools*
The moose likes Beginning Java and the fly likes StackOverflowError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "StackOverflowError" Watch "StackOverflowError" New topic
Author

StackOverflowError

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


Exception in thread "main" java.lang.StackOverflowError
at Test.<init>(Test.java:3)
at Test.<init>(Test.java:3)
at Test.<init>(Test.java:3)
at Test.<init>(Test.java:3)
at Test.<init>(Test.java:3)
at Test.<init>(Test.java:3)
at Test.<init>(Test.java:3)
at Test.<init>(Test.java:3)

I don't understand reason.


My one regret in life is that I am not someone else.
- Woody Allen
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10925
    
  12

what happens when you do this:

Test obj=new Test();

you make a Test object. What does it hold? Two Test objects. Each of those has to hold two Test objects, each of which have to hold two Test objects...

and eventually you run out of stack space.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: StackOverflowError
 
Similar Threads
Errors in the K&B bonus exam?
how many objects
Strange error on running the simplest code there is.
Null Pointer exception when accessing a static instantiated object with in the instance of
Null Pointer exception when accessing a static instantiated object with in the instance of a class.