SyntaxFix
Write A Post
Hire A Developer
Questions
Use the abs function:
abs
int sum=0; for(Integer i : container) sum+=Math.abs(i);