반응형
class Main {
	public static void main(String[] args) {
		
		String str1 = "Hello world";
        String str2 = "어서오세요.";
        
        String temp1 = str1.concat(str2); // 문자열 병합
        String temp2 = str1.substring(0, 5); // 문자열 분활
        
        System.out.printf("concat 사용 : %s\n", temp1);
        System.out.printf("substring 사용 : %s\n", temp2);
	} 
}
반응형

+ Recent posts