If string literals are being added on the string constant pool and the each of the String methods are creating a new String Object does it mean that the String objects returned by these methods are being added on the constant pool?
"String".replace('g','G') == "String".replace('g','G')
the code above prints false even though the outcome of the replace is "StrinG" since the replace method returns a new String Object then it just happens that both sides of the "==" are of different String Object that happens to have the same character sequence which is "StrinG"?
**edit:**as commented by Pshemo, yes I do know the difference between "==" and "equals()", the question is that if by any chance does the String outputed by the methods are being added also on the constant pool.