This article is a collection of Scala “object” examples. I put the word object in quotes there because it has at least two meanings in Scala. In the first meaning, just like Java, an object is an instance of a class.
In its second meaning, Scala has an
object keyword, and using that keyword lets you do a variety of things, including creating a
main method to launch your application, to create the equivalent of Java’s static methods, and also to create something called a companion object.