Having this method
void doSomething(String input)
{
//trick for create new object instead of reference assignment
String workStr= "" + input;
//work with workStr
}
Which is the java way for doing that?
Edit
- if I use input variable as input=something then Netbeans warns about assigning a value to a method parameter
- If I create it with new String(input) it warns about using String constructor
Perhaps the solution is not to assign nothing to input, or just ignore the warning..