手记

关于JAVA第三季作业的小猜想

public class Card {
public static StringBuffer[] newCard ;
public Card(){
System.out.println("---------扑克牌创建成功!--------------");
System.out.print("为:");

}
public void NewCard() {
    newCard = new StringBuffer[52];
    String[] str = { "方片","梅花","黑桃", "红桃"};
    for(int i = 0,k = 0;i < 4 && k < 5; i++){
        for(int j = 0;  j < 13; j++){
            newCard[k].append(str[i]);
            newCard[k].append(String.valueOf(j));
            System.out.print(newCard[k]+ ", ");
            k++;
        }
    }

}

}

0人推荐
随时随地看视频
慕课网APP