【问题标题】: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)。

【讨论】:

    猜你喜欢
    • 2013-11-29
    • 1970-01-01
    • 2014-12-27
    • 1970-01-01
    • 1970-01-01
    • 2011-02-24
    • 1970-01-01
    • 1970-01-01
    • 2018-12-04
    相关资源
    最近更新 更多