An object that has the same name as a class is called a companion object of the class, and it is often used to contain factory methods for the class that it complements:
Here is a proof that an object is a singleton, and not a static method in a class:
A companion object can also see private values and variables of the corresponding classes' instantiated objects:
An object is a singleton.
An object is a singleton. One object, that's it. This object is a replacement of static in Java, and is called upon much in the same way:
The parameterless execute method has been deprecated and will be removed in a future version of ScalaTest. Please invoke execute with empty parens instead: execute().
The trap method is no longer needed for demos in the REPL, which now abreviates stack traces, and will be removed in a future version of ScalaTest