Q: Busting when splitting in blackjack In my blackjack I have the players hit or stand and then to test to end the loop U have this code:
int runLoopCount1 = 0;
    for (int i = 0; i < players.length; i++) {
        if (players[i].wantSplit = false){
                if(players[i].getStatus() == true){
                    runLoopCount1++;
                }
        }

        else if (players[i].wantSplit = true){
            if ((players[i].splits[0].busted == true||
                 players[i].splits[0].standed == true) &&
                (players[i].splits[1].busted== true ||
                 players[i].splits[1].standed == true)){ // null pointer here 
                        runLoopCount1++;
                }
            }
        }
                
   if(runLoopCount1 == players.length){
        runLoop = false;
   }

Now I get a NullPointerException. I don't know why though?

A: Do you really mean if(players[i].wantSplit = false) or if(players[i].wantSplit == false)
the same to if(players[i].wantSplit = true) or if(players[i].wantSplit == true)

A: It's likely that splits in each player is not initialized properly.
players[i].splits[0].standed


A: It means that you're trying to access an object that's not instantiated.  so for instance, if you do:
players[i].wantSplit

but players[i] was not instantiated, then a null pointer exception will be thrown 
