대문자로 변경 (toUpperCase)

  • String클래스의 toUpperCase() 메서드를 사용

public class Test {
    public static void main(String[] args) {
        String str = "aaa";
        str = str.toUpperCase();
        System.out.println(str);
    }
}


AAA

 

소문자로 변경 (toLowerCase)

  • String클래스의 toLowerCase() 메서드를 사용

public class Test {
    public static void main(String[] args) {
        String str = "AAA";
        str = str.toLowerCase();
        System.out.println(str);
    }
}

aaa

+ Recent posts