Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

ArrayLIst Problem, help me to find the errors!

$
0
0
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);
resArr.add(button);
}

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!

Viewing all articles
Browse latest Browse all 2703

Trending Articles