I'm not sure what it's called exactly, but I was wondering how you can create a class which you can call multiple methods on in one call. For example, using an android class but it doesn't really matter, you can call all of the class' methods at once:
AlertDialog.Builder().setItem().setTitle().setPositiveButton().setCancelable() ...etc
The only way I can think that this could work is if every method returned this
, but that seems like it would cause problems. I'm not sure how, but it just seems like it would.
Also, does this technique have a name?