Scala object

  1. singleton object. Declared with object keyword.
  2. class instance object.
  3. companion object. Same name and file as a class.
    • protected object methods, only class can access them.
    • factory methods - https://www.baeldung.com/scala/classes-objects
    • https://docs.scala-lang.org/overviews/scala-book/companion-objects.html
    • generic programming

See also

Scala class