• 코드:
​x
 
1
public class prog {
2
    public static void main(String[] args) {
3
        String str = new String("Java");
4
        System.out.println("원본 문자열 : " + str);
5
​
6
        System.out.println(str.concat("수업"));
7
        System.out.println("concat() 메소드 호출 후 원본 문자열 : " + str);
8
    }
9
}
표준입력 & 실행옵션