public class StringTest {
public static void main(String[] args) {
String s1 = "java";
String s2 = "ja" + "va";
String s3 = "ja";
String s4 = s3 + "va";
System.out.println(s1 == s2);
System.out.println(s1 == s4);
}
}
First System.out.println(...); statement as expected outputs true, but why is second statement showing false as output?
I want to know which string is created in pool area and which in non-pool area of pool.