Scala object MODULE$

前端 未结 1 1314
挽巷
挽巷 2021-01-13 04:47

What\'s the purpose of Scala object MODULE$?

The following Scala object:

object TestScalaObject {
 val TEST_SYMBOL = \"*\"
 def test         


        
相关标签:
1条回答
  • 2021-01-13 05:49

    MODULE$ holds an instance of the instantiated class. See the Singleton pattern in Java. I don't know of a good source for it, so here's the Wikipedia entry for Singleton.

    0 讨论(0)
提交回复
热议问题