Fluent interfaces can be achieved through method chaining, but not all method chains are Fluent interfaces. In Fluent interfaces, method chaining always returns the same interface which is used by all chaining methods. For example:

public interface Car
{
    Car StartEngine();
    Car OpenWindows();
    Car CloseWindows();
    Car startAC();
}

Now Fluent interfaces is implemented with chaining as follows:

Car hondaCity = new HondaCity();
hondaCity.startEngine().openWindows().closeWindows().startAC();

Now simple method Chaining example:

Car hondaCity = new HondaCity();
hondaCity.getEngine(). //Get Engine Object
          getFilter(). // get Filter Object
          cleanFilter();

Author: Sandeep Kokate

Post inspired by lukaqueres.

Cover image by Carbon