Dear all,
I attempt to modify the
String value using the code shown below:
String temp = "Before";
System.out.println("Output 1" + temp);
method(temp);
System.out.println("Output 2" + temp);
public void method(String a) {
a = "After";
}
I expected the 1st and 2nd line will print "Before" and "After" but the both lines displayed "Before"!!!
How can I change the value of variable "temp"?
Regards,
Joe