Method Chaining Explained (in Computer Programming)

Publicado em: 10 January 2018
no canal de: 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!


Nesta página do site você pode assistir ao vídeo on-line Method Chaining Explained (in Computer Programming) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário dcode 10 January 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 11,850 vezes e gostou 170 espectadores. Boa visualização!