The $ colon is the character for the character :. Since: (and other letters) is an illegal letter in java for method names, but is allowed in scala, to encode it, you must enter the strategy in the legal name. Therefore, $ colon
Here, your code translates to arg :: Nil, which adds arg to an empty list, creating a List with arg as a separate item.
source share