I have an array that holds two doubles. I need to subtract number b from number a.
e.g. 30(number a) - 10(number b)
How do I iterate through my ArrayList and subtract these two numbers? I am not sure if I would need to iterate backwards or forwards.
My code so far. Does not produce the correct result, I am aware d - d would return 0 but I am unsure what to do here:
for (double d = numbersEnteredArrayList.size() - 1; d >= 0; d--) {
equals = d - d;
System.out.println(equals);
}