When does the pool change?
I have two questions: public static void main(String[] args) { String s1 = "bla"; String s2 = "b" +"l" + "a"; String s3 = "b".concat("l").concat("a"); if(s1 == s2) System.out.println("Equal"); else System.out.println("Not equal"); if(s1 == s3) System.out.println("Equal"); else System.out.println("Not equal"); } Why does s1 and s2 point to the same object, whereas s1 and s3 doesn't? ( There is no usage of new keyword ). If I get a string from the user and add to the above code these lines: BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); String name=in.readLine(); if(name