abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try true type val var while with yield _ : = => <- <: <% >: # @
(当java中使用到的标识符是scala中的保留字时的处理方法)
Backquote-enclosed strings are a solution when one needs to access Java identifiers that are reserved words in Scala. For instance, the statement Thread.yield() is illegal, since yield is a reserved word in Scala. However, here’s a workaround:(代码示例)
Thread.‘yield‘()