我开始编写 War(纸牌游戏)并且方法已经被实例化我需要知道为什么我不断收到这些错误。
import java.util.*;
public class CardGame {
public static void main(String[] args) {
CardDeck CardDeckA = new CardDeck();
//creates a standard card deck with 52 cards 1 - 10, J, Q, K, A diamond, spade, club, heart
//Card( int value, int suit)
int[] player1 = new int[52];
int[] player2 = new int[52];
int a = player1.length;
int b = player2.length;
for (int i = 0; a <= 26; i++) {
player1[i].deal(); //Error: int cannot be dereferenced
//deal( int n):Deals n cards from the top of the CardDeck, returns Card[]
}
for (int j = 0; a <= 26; j++) {
player2[j].deal();//Error: int cannot be dereferenced
}
}
}