Greg Brannon wrote:- I don't know what you mean by "so that I can put together multiple methods in a single line." Can you show an example?
I believe he's talking about "method chaining".
If the methods all return
this, you can do things like:
It's really common in JavaScript, but not so much in Java APIs for some reason.
I frequently wish that the JavaBean standard had specified that setters return
this. It'd make code so much terser.
If that's the intent, then all those return statements should be: