₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,275 members, 8,449,511 topics. Date: Tuesday, 21 July 2026 at 10:10 PM

Toggle theme

Method Chaining In Java - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingMethod Chaining In Java (913 Views)

1 Reply

Method Chaining In Java by skptricks(op): 6:54am On Aug 27, 2018
Post Link : https://www.skptricks.com/2018/08/method-chaining-in-java.html


The term method chaining refers to both a design and a convention. Each method returns an object, allowing the calls to be chained together in a single statement. Chaining is syntactic sugar which eliminates the need for intermediate variables. A method chain is also known as a train wreck due to the increase in the number of methods that come one after another in the same line that occurs as more methods are chained together even though line breaks are often added between methods.

It applies to classes and methods where:
multiple methods are potentially going to be called on the same object;
the methods in question need no return value.
The idea of method chaining is that if the methods need no "useful" return value, then the method can return this

1 Reply

Pro JS Devs, Please Is This Variable ChainingQuestion On Regular Expressions In JavaNetwork Programming In Java (UDP And TCP)234

Vacancy - Front-end DeveloperEthical Hacking Tutorial / Cybersecurity....Create Dropdown Menu In React Native