public class Goods{
String shanPinName;
double size;
double jiaGe;
int kuCun;
}
import java.util.ArrayList;
public class testGoods{
public static void main(String[] args){
ArrayList<Goods> arr=new ArrayList<Goods>();
Goods d1 =new Goods();
Goods d2 =new Goods();
Goods d3 =new Goods();
arr.add(d1);
arr.add(d2);
arr.add(d3);
d1.shanPinName="小米";
d1.size=5.5;
d1.jiaGe=1999;
d1.kuCun=10;
d2.shanPinName="华为";
d2.size=6.0;
d2.jiaGe=3500;
d2.kuCun=15;
d3.shanPinName="魅族";
d3.size=5;
d3.jiaGe=1000;
d3.kuCun=19;
//String a=arr.get(0);
//System.out.println(arr.size());
System.out.println("品牌 "+"尺寸 "+"价格 "+"库存");
for(int i=0;i<arr.size();i++){
System.out.println(arr.get(i).shanPinName+" "+arr.get(i).size+" "+arr.get(i).jiaGe+" "+arr.get(i).kuCun);
}
}
}