Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ArrayLIst Problem, help me to find the errors!

Hi, here is part of my code, after compilation, I get a Null Pointer Exception on the ORANGE part, I don't know where goes wrong.

for (int i = 0; i < N_BITS; i++){
ResultButton button = new ResultButton(0);
add(button, constraint);
[color=Orange]resArr.add(button);[/color]
}

Note:
1. N_BITS is a just a constant.
2. resArr is an ArrayList, containing ResultButton, instance variable.
3. class ResultButton is defined by myself.

HELP ME TO FIGURE OUT THE PROBLEM, THANK YOU!
Sign In or Register to comment.