【问题标题】:Scala methods with = (equality sign) [duplicate]带有=(等号)的Scala方法[重复] 【发布时间】:2012-11-08 23:57:25 【问题描述】: 可能重复:When to use the equals sign in a Scala method declaration? 有什么区别 def x {} 和 def x = {} ? 【问题讨论】: 绝对!感谢您提供链接,@om-nom-nom。 标签: function scala procedure 【解决方案1】: def x {} 被称为“过程”风格,是def x: Unit = {} 的简写(引用this post 中的Viktor Klang)。 【讨论】: