S
SlowLearner
I'm trying to create a method which returns a flag and a string. So I
passed the String as an argument but it doesn't change. I thought all
objects were past as references and so I could change the value. What
am I doing wrong?
SomeEvent(....) {
String FolderName="123";
if (test(FolderName)) Do SomeThing;
// FolderName still 123 at this line. Why isn't it asdfg?
}
public boolean test(String txt) {
txt="asdfg";
return true;
}
passed the String as an argument but it doesn't change. I thought all
objects were past as references and so I could change the value. What
am I doing wrong?
SomeEvent(....) {
String FolderName="123";
if (test(FolderName)) Do SomeThing;
// FolderName still 123 at this line. Why isn't it asdfg?
}
public boolean test(String txt) {
txt="asdfg";
return true;
}