因为用的是普通数组,所以编写的代码可能比较长,而且有的功能还比较不健全,代码如下:

 

0.定义数组(因为用static修饰可以不用New,比较方便,但可能比较损耗性能)

 1 //订餐人名字
 2     static String [] names=new String[10];
 3     //保存菜品
 4     static String [] sums=new String[10];
 5     //送餐时间
 6     static int [] times=new int[10];
 7     //地址
 8     static String [] addres =new String[10];
 9     //状态
10     static int [] states= new int[10];  
11     //总金额
12     static double [] sumPrice=new double[10];
13     //点赞
14     static int [] upvote=new int[10];
数组

相关文章: