File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inner classes

 
pallavi utukuri
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any1 explain y does the below code throw StackOverflowError???

where as if line 1 is removed everything goes well!

Code tags and a few spacers added - Barry
[ April 11, 2004: Message edited by: Barry Gaunt ]
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isnt it that you are initializing the inner class within the Inner class inn1?
because this is a variable which is initialized every time you create a new instance of inn1...it will be a cycle that never ends and hence the runtime exception...
comment the line inn1 z= new inn1(); and uncomment the //1 line and it will work fine
[ April 11, 2004: Message edited by: RajaniKanth Bhargava ]
 
pallavi utukuri
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ys ur logic makes sense thannks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic