text: Use double, not Double. \nYou can't use the arithmetic operators you would normally use on primitives (i.e. double) on objects (i.e. Double). One solution would be to convert your Double objects into doubles using the doubleValue() method and do your calculations on those.