Tell the advantages of companion objects when used in Scala?

devquora
devquora

Posted On: Feb 22, 2018

 

    1 Answer Written

  •  devquora
    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).

Related Questions

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..