10
I want to send a string to a method and change the string there. The method should return void. Example:
String s = "Hello";
ChangeString(s);
String res = s;
//res = "HelloWorld"
-------------------------------------------
private void ChageString(String s){
s = s + "World";
}
How can I do it in Java? Can it be done without adding another class?
Thanks! PB