有没有办法做到这一点:
Player[] player = new Player[numOfPlayers];
for(int i=0; i < numOfPlayers; i++){
player[i] = new Player("Player"+i, 0);
}
//becomes like this right?
player[0].name='a';
player[1].name='b'
player[2].name='c'
player[3].name='t'
player[i].name='baz'
如何删除说player[2]
以便新的对象数组变为:
player[0].name='a';
player[1].name='c'
player[2].name='t'
player[i].name='baz'