aspose file tools
The moose likes Beginning Java and the fly likes Class initialization error! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Class initialization error!" Watch "Class initialization error!" New topic
Author

Class initialization error!

Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147


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


What's the problem, i have no idea


If you think you've done too much, usually it means you've done too few.
Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
Ooops! Problem solved!

I've just put this line:


before these ones:
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9191
    
    2

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 ]


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
Thanks anyway!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Class initialization error!
 
Similar Threads
Retrieve Value from Array to be Displayed
While Loop in Gantt Chart values