자바

자바 Math.abs()

cdbitmana 2020. 10. 29. 19:42

절대값으로 반환해줌

 

int타입이 아니기 때문에 int타입 변수로 받는다면

 

int a = (int)Math.abs(-1);