这可能是一个有点太基本的问题。我已经尝试了已经给出的方法,但它不起作用。我想从另一个班级调用 ENUM。 package com.blackjack.game.cards;public enum Card implements Comparable<Card> { ACE(1, 11), KING(13, 10), QUEEN(12, 10), JACK(11, 10), TEN(10, 10), NINE(9, 9), EIGHT(8, 8), SEVEN(7, 7), SIX(6, 6), FIVE(5, 5), FOUR(4, 4), THREE(3, 3), TWO(2, 2); public final int rank; public final int value; private static final String[] CARD_NAMES = { "joker", "ace", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "jack", "queen", "king" }; private Card(final int rank, final int value) { this.rank = rank; this.value = value; } public int getRank() { return rank; } public int getValue() { return value; }我正在按以下方式进行操作,但它不起作用。import com.blackjack.game.cards.Card;Card card = new Card.ACE;
添加回答
举报
0/150
提交
取消