1

Scala package is cumulative, so package a.b can also be written as

package a
package b

Is there any difference between these or is it just a matter of programming style?

Abhijit Sarkar
  • 21,927
  • 20
  • 110
  • 219

1 Answers1

1

The difference is that with

package a
package b

everything from package a is in scope, not just from a.b.

Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
  • Thank you. I accepted your answer but also marked my question as dup of [this](http://stackoverflow.com/questions/3660806/whats-the-motive-behind-chained-package-clauses-in-scala) as pointed out by Chris Martin. – Abhijit Sarkar Nov 21 '16 at 07:33