如何获得使用合成的机器总数

时间:2014-01-27 22:58:32

标签: java composition

我如何获得使用合成的机器总数?我在想这样的事......但我收到错误The operator + is undefined for the argument type(s) int, AssemblyLine

private List<AssemblyLine> machines = new ArrayList<AssemblyLine>();

 public int getMachine(){

     int total= 0;

     for (AssemblyLine machine : machines) {

         total = total + machine;


     }
     return total;

 }

0 个答案:

没有答案