You are right, it does appear to be plain weird. It should evaluate differently than
The_Don expected, with the
-> operators operating left to right, so you did read it correctly.
BrowserUK made a note about the Java APIs working this way, perhaps
name(),job(),wife(), and (presumably)
fav_food() all return the object that called it, that much is not clear.
Personally, when writing classes I tend to have my mutators (set()s) return nothing, making a clear distinction between accessors and mutators (except in certain circumstances).