oop - What is the rationale behind having companion objects in Scala? - Stack Overflow
Companion objects are useful for storing state and methods that are common to all instances of a class but they do not use static methods or fields. They use regular virtual methods which can be overridden through inheritance. Scala truly has nothing staticRead full article from oop - What is the rationale behind having companion objects in Scala? - Stack Overflow
No comments:
Post a Comment