数组存储表格数据练习(未完成)
在这里插入代码片
- 数组存储表格数据练习
*/
package cn.wu.array;
import java.util.Arrays;
public class Exe4 {
public static void main(String[] args) {
Goods[] gss = {
new Goods(1,“鼠标”,“BZ_001”,99.21,0.9),
new Goods(2,“键盘”,“WQ_102”,209.5,0.7),
new Goods(3,“显示器”,“BK_001”,1025.6,0.8),
new Goods(4,“主机”,“GQ_XF_12”,4005.8,0.5),
new Goods(5,“内存条”,“DM_PH_13”,200.0,0.3)
};
// Goods Dp = new Goods(price,dicunt);
System.out.println(Arrays.deepToString(gss));
}
}
class Goods {
private int id;
private String name;
private String marque;
private double price;
private double dicount;
public Goods() {
}
@Override
public String toString() {
return "Goods [id:" + id + &#