Two strings are created.
Actually
java forms a pool of literal strings whenever a new string object is created. So every time, it has to form a new string object, it first checks its pool of literal strings. If the same string exists in the pool, it refers to the same string.
In our case, a string object is created for s1.
No string object is created for s2, as it refers to same object s1.
Since, strings are immutable another string object is created for s3.
No string object is created for s4, as said above.
The things would be different, if we say
String s2 = new String(s1)
In this case, another string object is created in the programmers space at compile time. (At run it checks for the existing pool of literal strings.) The string object in programmers space can be placed by calling the method intern() of the String class.