I've worked a lot of refactoring on my old code and I noticed that I have created strings in two ways:
First way - using a new operator:
String stringA = new String ("String A");
Second way - using literal:
String stringB = "String B";
Could anyone explain which of these way is better and why?