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
  • 19,114
  • 16
  • 94
  • 178

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
  • 160,869
  • 33
  • 291
  • 457
  • 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