| 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
|
|
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!
|
 |
 |
|
|
subject: Class initialization error!
|
|
|