Here is my code :
result = method1().method2().method3();
I would like to know the execution hierarchy of the above code/
Just go through the following points.
As per your statement, the execution hierarchy will be as follows:
Hope it clarifies you doubt.
Same as this:
result1 = method1();
result2 = result1.method2();
result = result2.method3();
I'm explaining hierarchy of the above code with small example.
result = method1().method2().method3();
Example:
getYear().toString().trim(); //like method1().method2().method3()
First will be execute get year() which returns a Integer:
2016.toString().trim();
Secound will be execute toString() method of integer class which returns an string:
"2016".trim();
In Last trimming the stringwith trim() method of string class.