陈婉
2016-07-07 17:32
//——---------------主干程序-----------------------------------
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;
}
}
问题如图片所示:
你那PukeCollection类的那个构造函数不是这样写的 构造函数没有返回值的 应该去掉void
Java入门第三季
409792 学习 · 4340 问题
相似问题