What is a companion object?



What is a companion object?..

Answer / Deepankar Arya

"A Companion Object in Scala is a synthetic singleton object created along with its companion class. It has the same name as its companion class and is automatically imported when you import the companion class. This allows for easier access to the instance methods of the companion class."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

What is the best Scala style checker tool available for Play and Scala based applications?

1 Answers  


Why Scala does NOT have 'static' keyword? What is the main reason for this decision?

1 Answers  


What is a applicative?

1 Answers  


Which scala library is used for the functional programming?

1 Answers  


What is for-comprehension in scala?

1 Answers  


What is seq in scala collection?

1 Answers  


What are the differences between Array and ArrayBuffer in Scala?

1 Answers  


what are the features of scala?

1 Answers  


What is an Expression? What is a Statement? Difference between Expression and Statement?

1 Answers  


What is flatmap in scala?

1 Answers  


What is lazy val in scala?

1 Answers  


What is default access modifier in Scala?Does Scala have 'public' keyword?

1 Answers  


Categories