Scala变量和常量的声明

标示符的命名规则

1. 字母或下划线开头

2. 以操作符开头,且只包含操作符(+ - * / # !等)

3. 用反引号`....`包括的任意字符串,即使是 Scala 关键字(39 个)也可以
• package, import, class, object, trait, extends, with, type, for
• private, protected, abstract, sealed, final, implicit, lazy, override
• try, catch, finally, throw
• if, else, match, case, do, while, for, return, yield
• def, val, var
• this, super

• new
• true, false, null

原文地址:https://www.cnblogs.com/rainbow-1/p/15750746.html