Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
来源:百度知道 编辑:UC知道 时间:2024/06/14 18:25:45
at Deck.<init>(Deck.java:31)
import java.util.*;
public class Deck
{
private String PrimaryDeck[];
private String DealDeck[];
private String tempDeck[];
private String face[];
private String suit[];
private String Dealt[];
private int i, j, flag, card, DealCard, currentCard, DealNumber, CardNumber;
public Deck()
{
currentCard = 0;
face = new String[]{"Clubs","Diamonds","Hearts","Spades"};
suit = new String[]{"ace","two","three","four","five","six","seven","eight","nine","ten","jack","queen","king"};
PrimaryDeck = new String[CardNumber];
int count=0;
{
import java.util.*;
public class Deck
{
private String PrimaryDeck[];
private String DealDeck[];
private String tempDeck[];
private String face[];
private String suit[];
private String Dealt[];
private int i, j, flag, card, DealCard, currentCard, DealNumber, CardNumber;
public Deck()
{
currentCard = 0;
face = new String[]{"Clubs","Diamonds","Hearts","Spades"};
suit = new String[]{"ace","two","three","four","five","six","seven","eight","nine","ten","jack","queen","king"};
PrimaryDeck = new String[CardNumber];
int count=0;
{
1、CardNumber没有初始化
2、在构造函数中的循环有些括号的配对出现了问题,有几句应该在循环里的,比如count=count+1;这一句。
3、DealDeck = new String[CardNumber];DealDeck = PrimaryDeck;这一句不懂你是什么意思,如果是想要在DealDeck里面复制一份和PrimaryDeck完全相同的内容的话,应该使用DealDeck=PrimaryDeck.clone();
4、其他的函数里面也有类似的问题。
5、没有给出含有main函数的Demo,无法调试。
Exception EOleSysError in module
英语作文,主题:in th park
Realistic novel in the 18th century
on June 5th和in June
Christmas in the 13th Month
nothing in thé world 是什么意思?
Report ranks China 6th in overall strength 怎么翻译?
谁能告诉我feminism in 17th century 在英国
The film was released on 11th July in China
Fashions in America before the 19th century_____those of Egland.