“는 문자열을 출력할 때 사용되어서 “ 출력하고 싶을 때에는 \를 앞에 붙여주면 된다.package test;
public class Test {
public static void main(String[] args) {
String s = "ㅁㄴ"ㅇㄴㅁ";
}
}해당코드는 오류가 난다 하지만
“ 앞에 \ 를 붙여주면 함께 출력이 된다.package test;
public class Test {
public static void main(String[] args) {
String s = "ㅁㄴ\"ㅇㄴㅁ";
System.out.println(s);
}
}
Share article