I'm actually running this code in Scala
val obj2 = obj1.method1()
val result = obj2.method2(obj2.name)
I would know if is somehow possible use the obj2 in a argument concatenating the calls, to clarify I would write something like
val result = obj1.method1().method2(_.name)
where _ is referring to the object previously computed. I don't know if it's possible, it's just a style question, the first code works fine