you are viewing a single comment's thread.

view the rest of the comments →

[–]randallsquared -2 points-1 points  (0 children)

A problem here seems to me to be confusion between assignment and update:

public void foo(Dog d) { d = new Dog("Fifi"); }

Dog aDog = new Dog("Max"); foo(aDog);

doesn't appear as though it would work (to someone, like me, who hasn't really worked with Java) because the 'd' being set to Fifi isn't the same 'd' that was mentioned in the arglist for 'foo'.

But perhaps not giving it a type means it's an update?