I really don't know when and why should I use the constructor for String and not the literal way. I have already looked, found some answers of differences which were not really clear... but nothing about the best practices or "why?" and "when?"
I understood that literal definition is treated by the JVM but also that they are not handled by the Garbage Collector (like static staff, annotations ...)... could this really be a problem for the memory of the JVM ?
I added here the shortest comparison that I found:
What is the difference between creating String as new() and literal? When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.
Thank you for your time and help.