package demo;
public class Goodtest {
public static void main(String[] args) {
Good arr[]=new Good[3];
Good g1=new Good("001","小米",5990,100);
Good g2=new Good("002","保温杯",227,100);
Good g3=new Good("003","枸杞",12.7,54);
arr[0]=g1;
arr[1]=g2;
arr[2]=g3;
for(int i=0;i<=arr.length;i++) {
Good good=arr[i];
System.out.println(good.getid()+good.getname()+good.getprice()+good.getcount());
}
}
}