This is my method
private char[] listFindChar;
public void setlistFindChar(char letter){
int pos;
if (listFindChar !=null)
{
pos = listFindChar.length;
pos ++;
listFindChar[pos]=letter;
}
else{
listFindChar[0] = letter; (cause problem)
}
Why the char is not add in the array of chars at the position[0]??
Thanks for helping me!!
Frank
You need to initialize the array, e.g.:
Otherwise, you just defined an array that is not initialized and points to some place throwing NullPointerExceptions at you for some reason…