Ordo Ordo - 1 year ago 64
Java Question

Using abs () method in java. My compiler doesn't know the method

I have a simple question, but i can't find a solution for it.

I want to use

the abs ()
method but it doesn't work. I'm always getting the
Error:" Cannot find symbol: method abs(int)".

I have already tried to use the method by including
"import java.math"
above the code. But that doens't work too.

Answer Source

Are you using:


or just



Use Math.abs()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download