For eg: Say a method called addUs(a,b) adds a and b.
So the definition will be
int addUs(int a, int b){
return a+b;
}
But now if you want your arguments to be Objects of a class say
class Demo{
int height;
int width;
}
You want the same function addUs() to return a new object which would have attributes height and width having values as sum of the height & width of the 2 arguments passed.
So now the definition would be:
Demo addUs(Demo a, Demo b){
this.height = a.height + b.height;
this.widht = a.widht + b.width;
return this;
}