m*p 发帖数: 1331 | 1 【 以下文字转载自 JobHunting 讨论区 】
发信人: mbp (Mac Book Pro), 信区: JobHunting
标 题: java: use vector to shuffle a deck of Card 问题
发信站: BBS 未名空间站 (Thu Mar 3 00:40:48 2011, 美东)
要求用vector实现shuffle a deck of Card,如下:
public class Card {
private int value;
Card(int v) {
value = v;
}
public void print(){
System.out.print(value+";");
}
}
public class DeckShuffle {
private final int num;
Vector deck = new Vector();
// implement this shuffle function. DO NOT USE Collections.shuffle() !!
public void shuffle(){
// your code goes here!
}
} |
|