You called your class Math
, so the built-in java.lang.Math
class can't be resolved. So Java thinks you're attempting to call your own abs
method that doesn't exist.
Call your class something else, or refer to Math.abs
with a fully qualified class name: java.lang.Math.abs(4)
.