Tell the advantages of companion objects when used in Scala?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Jan 29, 2019


    1 Answer Written

  •  Sharad Jaiswal
    Answered by holothuroid

    Unlike static methods within a class, an object is... an object. It may implement traits or inherit from a superclass. A companion object may even inherit from it's own class (provided it's not a case class).

Please Login or Register to leave a response.

Related Questions

Scala interview questions

What do you mean by a Scala map?

The collection of key-value pairs where the key can retrieve the values present in a map is known as a scala map. The k..

Scala interview questions

List the advantages of using scala over other functional programming languages.

Some of the advantages due to which scala is preferred over other functional programming languages are listed below: As..

Scala interview questions

Which Scala library is used for the functional programming?

pure functional data structure is present in the scala library. It also complements the standard Scala library. It also..