我宣布了两张牌:
Card card1 = new Card('3', Card.Suit.clubs);
Card card2 = new Card('T', Card.Suit.diamonds);
这有效:
Hand hand1 = new Hand();
hand1.takeCard(card1);
但是为什么这不起作用?它在第二行给了我一个 NullPointerException :
Hand[] hand = new Hand[2];
hand[0].takeCard(card2);