Scala Objects
In Scala, an object can mean an instance of a class. Also, “object” can be used as a keyword.
Lets see usage of object as keyword in this article.
Singleton Object
A singleton is a class that can have only one instance.
We can use the object keyword to create a Singleton object as follows :
object Greeting { def greet{ println("Hello"); } }
With Greeting defined as an object, there…
View On WordPress














