创建扑克牌添加时出现问题,请求指教
//——---------------主干程序-----------------------------------
package com.afterHomework.puKe;
import java.util.ArrayList;
import java.util.List;
public class PukeMajor {
/**
* @param args
*/
public void pukeMajor(){
}
public void createPuke(){
List<PukeCollection> pukecList=new ArrayList<PukeCollection>();
System.out.println("-------------------创建扑克牌--------------------");
String[] variety={"黑桃","红桃","梅花","方片"};
String[] number={"2","3","4","5","6","7","8","9","10","J","Q","K","A"};
for(int i=0;i<variety.length;i++){
for(int j=0;j<number.length;j++){
pukecList.add(new PukeCollection(variety[i]+number[j]));
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
//----------------------------------辅助程序------------------------
package com.afterHomework.puKe;
public class PukeCollection {
public String variety;
public String number;
public void pukeCollection(String variety,String number){
this.variety=variety;
this.number=number;
}
}
问题如图片所示: