Can a Variable be populated from another method in another class.
Posted on 2003-11-10
I've ran across something that I've never seen in Java before. I step throught somebody's code to get a line of data:
public class VendorMaster
next = loaddata.getLine(currentLine);
public class LoadData
public boolean getLine(byte line)
line is populated here
When I step through the code in VendorMaster after executing getLine, currentLine is populated! I didn't know you can populate a variable in the called method and make its contents visible in the calling class without actually returning it back in "return" statement. Why is this happening? Is this safe to implement especially with having multiple threads? Thanks.