我正在写一个计算机股票程序,它允许用户定义和显示一个数组中的一种计算机。此刻打印一个数组中的一台计算机(例如,第一个数组),但并不是所有特定模型的列表。打印ArrayList
model = Console.askString("A or B ? ");
item = mlist.find(model);
if (item == null)
System.out.println("Cannot find " + model);
else
item.print("Laptop details...");
break;
什么是'mlist'? 'find'会返回所有匹配,还是只返回第一个? – 2013-05-06 13:00:05
什么是'item'?请提供更多相关部分。 – Maroun 2013-05-06 13:00:09
你可以发布你得到的输出和你期望的输出吗? – 2013-05-06 13:01:40