Joseph Cho wrote:System.out.println(questionPanel.questions.get(0).answer);
gives me null.. but it holds a value..
Well that sounds right; otherwise the
.answer bit would have thrown NullPointerException.
How do I access the values out of the ArrayList from another class properly?
Exactly as you are doing; it doesn't sound to me like that's your problem. The fact is that
answer is null,
not the ArrayList entry.
However, one tip I would give you is that stringing lots of derefs ('.') together can make things difficult to follow, so why not just break them up? viz:
It may seem like a lot more code, but it'll help an awful lot in debugging.
HIH
Winston