Method Chaining Explained (in Computer Programming)

Publicado el: 10 January 2018
en el 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!


En esta página del sitio puede ver el video en línea Method Chaining Explained (in Computer Programming) de Duración hora minuto segunda en buena calidad , que subió el usuario dcode 10 January 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 11,850 veces y le gustó 170 a los espectadores. Disfruta viendo!