编译错误,需要标识符
ackage day0415;import java.util.Arrays;
public class CardsPractice {
public static void main(String[] args) {
Card[] cards = new Card[54];
int i=0;
for(int rank = Card.THREE;rank<=Card.DEUCE;rank++){
cards[i++] = new Card(Card.DIAMOND,rank);
cards[i++] = new Card(Card.CLUB,rank);
cards[i++] = new Card(Card.HEAT,rank);
cards[i++] = new Card(Card.SPADE,rank);
}
cards[i++] = new Card(Card.JOKER,Card.BLACK);
cards[i++] = new Card(Card.JOKER,Card.COLOR);//生成牌
}
System.out.println(cards.lenth);
}
class Card{
private int rank;//点数
private int suit;//花色
/** 方块*/
public final static int DIAMOND = 0;
/** 梅花*/
public final static int CLUB = 1;
/** 红桃*/
public final static int HEAT = 2;
/** 黑桃*/
public final static int SPADE = 3;
/** 王*/
public final static int JOKER = 4;
public final static int THREE = 0;
public final static int FOUR = 1;
public final static int FIVE = 2;
public final static int SIX = 3;
public final static int SEVEN = 4;
public final static int EIGHT = 5;
public final static int NINE = 6;
public final static int TEN = 7;
public final static int JACK = 8;
public final static int QUEEN = 9;
public final static int KING = 10;
public final static int ACE = 11;
public final static int DEUCE = 12;
public final static int BLACK = 13;
public final static int COLOR = 14;
Card(int suit,int rank){
this.suit = suit;
this.rank = rank;
}
public int getSuit(){
return this.suit;
}
public int getRank(){
return this.rank;
}
}
问题出在System.out.println(cards.lenth);
编译提示需要标识符,没想明白错在哪里?