Where to put package objects | Contents |
Package objects are compiled to class files named package.class which are the located in the directory of the package that they augment. So the package object fruits would be complied to a class with fully qualified name gardening.fruit.package (Note that, even though package is a reserved word in Java and Scala, it is still allowed as part of a class name on the JVM level. In Scala, you can even define it directly, using backticks:
package gardening.fruits
object `package` { ... }
Next: The Scala package object
Where to put package objects | Contents |