Singleton Scala actor?

actor, object, scala, singleton

Solution

The `object` keyword is essentially creating an anonymous class and a single instance of that class. So yes, that code will be fine - `Xyz` will be a reference to an object that is an Actor.

Problem

Simple question. Can I do this: ``` object Xyz extends Actor { ... } ``` or do Actors have to be classes with instances?

Original source