I am trying to get the sum of all the byte arraylist from position 1 to end when i try to add i get error as "The operator + is undefined for the argument type(s) int, Object"
I have a finalbyte arraylist
ArrayList finalbyte = new ArrayList();
finalbyte.add(A);
finalbyte.add(B);
finalbyte.add(C);
finalbyte.add(D);
Am adding each value from different sources and the output of Syso looks like {67,8,1,-25,4,2,2,2,2}, the values are different for each run.Now am trying to add these values from {8,1,-25,4,2,2,2,2} 1st till the end position.
for(int i=0;i<finalbyte.size();i++) {
System.out.println(""+finalbyte.get(i));
value=value+finalbyte.get(i);
}
I want sum, value= {from 1st + end of byte list} and finalbyte.add(value); how can i add byte array values and add it back again to the bytearray list?