본문 바로가기
JAVA/문법, Collection

JAVA abs function

by wanna_dev 2024. 1. 13.
import java.lang.Math;
int number = -7;
int absoluteValue = Math.abs(number);
System.out.println("Absolute value: " + absoluteValue);

 

 

https://www.turing.com/kb/java-absolute-value

 

Java Math Absolute Value Abs() Method

Learn how to use the absolute value function (abs()) in Java with this beginner's guide. Understand its syntax & usage examples to manipulate numerical values.

www.turing.com