Function:)
:: is a pattern matching pattern. In Scala, variables starting with lowercase are used for variables that must be matched. Variables starting with uppercase (or enclosed in backticks) are used for existing variables that are used as part of the template for matching.
source share