我有一个Java方法,我在其中总结一组数字.但是,我希望任何负面数字都被视为正数.所以(1)+(2)+(1)+( - 1)应该等于5.
我确信有这么简单的方法 - 我只是不知道如何.
java negative-number
java ×1
negative-number ×1