2

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

What's the difference between

def x {}

and

def x = {}

?

Community
  • 1
  • 1
Hbf
  • 3,074
  • 3
  • 23
  • 32

1 Answers1

3

def x {} is called "procedure" style, it is shorthand for def x: Unit = {} (quoting Viktor Klang from this post).

Hbf
  • 3,074
  • 3
  • 23
  • 32