Explanation of singleton objects in Scala

后端 未结 4 499
Happy的楠姐
Happy的楠姐 2021-01-31 03:16

I get the coding in that you basically provide an \"object SomeClass\" and a \"class SomeClass\" and the companion class is the class declaration and the object is a singleton.

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-31 03:49

    Yes, it is basically a way of providing class methods when used as a companion object.

提交回复
热议问题