JAVA언어

자습

성-민 2023. 1. 31. 10:04

str.equals()

문자열과 문자열 비교

문자열과 문자열을 비교할 때 ==을 쓰면 저장된 위치를 비교하는 것이다.

 

거듭 제곱 구하기

Math.pow(n, m)

n의 m승

 

제급근(루트) 구하기

Math.sqrt(n)

n의 제곱근(루트)

 

Integer[] 의 내림차순 배열

import java.util.Collections;

Collections.sort(x, Collections.reverseOrder());

 

소문자 변형 / 대문자 변형

.toLowerCase()

.toUpperCase()