Assuming that these methods ( examineColor , bargain and buy ) are called for their side effects and not for their return values, you can use a chain template in which each of these methods returns this , allowing you to write code like this:
val c1 = new Car() c1.examineColor.bargain(300).buy
source share