String.substring()call with single
0index found JAVA-W1077
String.substring(int) with just
0, as that would effectively just return a copy of the string.
Strings are immutable, and it's possible to copy a string just with its reference. If you absolutely need a new string (for referential identity purposes, maybe), use
String's copy constructor.
String a = "something"; String b = a.substring(0); // not very useful...
To actually copy a
String, you can construct a new one with
String's copy constructor:
String b = new String(a);