When to use the equals sign in a Scala method declaration?

前端 未结 7 1299
春和景丽
春和景丽 2020-11-28 05:09

With equals sign:

object HelloWorld {
  def main(args: Array[String]) = {
    println(\"Hello!\")
  }
}

Without equals sign:



        
7条回答
  •  悲哀的现实
    2020-11-28 06:04

    As time as progressed the default style has changed, and this has been mentioned in many of the comments to answers, it is recommended in the official style guide to use the = syntax for function declarations.

提交回复
热议问题