java string1 JAVA string과 string buffer 의 차이점 문자열을 비교할때는 되도록 equals 을 사용하는 것이 좋다 package java_week2; public class StringTest { public static void main(String[] args) { String a = "한국"; String b = "한국"; StringBuffer c = new StringBuffer("한국"); StringBuffer d = new StringBuffer("한국"); if(a==b) System.out.println("a and b is same1"); if(a.equals(b)) System.out.println("a and b is same2"); if(c==d) System.out.println("c and d is same1"); if(c.t.. 2015. 10. 27. 이전 1 다음