As Both expression gives String object, but there is difference between them. When we create String object using new() operator, it always create a new object in heap memory. On the other hand, if we create object using String literal syntax e.g. String s2 = "Test"; it may return an existing object from String pool , if it's already exists. Otherwise it will create a new string object and put in string pool for future re-use.
What if we create a "Test" String in heap memory using new key word.Does String literal point to already created String(Which i created using new keyword) or not?