Method Chaining Explained (in Computer Programming)

Pubblicato il: 10 January 2018
sul canale di: dcode
11,850
170

It is common to see the 'method chaining' syntax in source code all across the world and in almost every object oriented programming language.

Also called 'named parameter idiom', it looks like a chain of methods being called one after another, hence the name 'method chaining'.

It works because the methods that are being called on the object are actually returning the SAME instance of that object, meaning another method of that object can be called right after it nice and easily.

In this video I show you an example of how you can implement method chaining in Java by creating a new class that supports it. The class is a simple number wrapper with an addition and print method.

For your reference:
https://en.wikipedia.org/wiki/Method_...

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!


In questa pagina del sito puoi guardare il video online Method Chaining Explained (in Computer Programming) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato dcode 10 January 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 11,850 volte e gli è piaciuto 170 spettatori. Buona visione!