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

Class initialization error!

 
Vadim Vararu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This goes ok! If i decomment this line
from constructor, i get such error:


What's the problem, i have no idea
 
Vadim Vararu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ooops! Problem solved!

I've just put this line:


before these ones:
 
Ankit Garg
Sheriff
Posts: 9495
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vadim, the problem is simple, your individual references are initialized before the ArrayList. That's why the ArrayList is null when you try to add the element to it. Try this sequence of declaration



[Edit: Oops, I'm late ]
 
Vadim Vararu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks anyway!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic