Simple questions like this one can very quicly be answered by writing a small test program and compiling and running it. You'll most likely have an answer quicker if you do that instead of asking it in the forum, and you also don't have to waste other people's time.
Experimenting with Java is a great way of learning it.
Hi Gaurav, s3==s4 and s4 == s5 both will return false, because s4 brings the concatinated String of s1 and s2. Similarly, you create a new String object s5 with the same value of s1+s2; which is again "abcdef".
A more important thing to understand is when you write s3 == s4, then two different String references are compared, even though their values are same.
The above concatenation is done at compile time and hence JVM sees it just like our s3 variable and they both are got from the Literal pool (Flyweight design pattern) and hence s3 == s6 will return True.
SCJP 96% | SCWCD 90%| SCJP mock exams | My SCJP blog