Is it a feature of the parameter-less methods in Scala that I can use the return values inside the parenthesis?
Joined: Nov 28, 2012
Yes, it's the same as "contents()" in Java. The method can't be called with any parameters so the parenthesis aren't used for arguments. Contents is called first, and then the parenthesis access the returned array by index:
This is different from a method with an empty parameter list which can be called with or without parenthesis: