I read some code here: Is Java "pass-by-reference" or "pass-by-value"?
public void foo(Dog d)
{
d.getName().equals("Max"); // true
d.setName("Fifi");
}
Dog aDog = new Dog("Max");
foo(aDog);
aDog.getName().equals("Fifi"); // true
Can I perform the same with the Byte
object. I am at this point in my code and wondering how to "set" the value of the byte object?
If i use the =
assignment operator it seems to perform the new Byte()
autoboxing?! and therefore the value is not passed back.
Any ideas? Regards.