Does a Companion object access private members of it’s Companion class in Scala?
Answer / Atish Kumar Paswan
No, by default, a Companion object cannot access private members of its Companion class in Scala. To allow access, the private members should be marked as 'private[this]', which restricts them to only the companion object and its enclosing class.
| Is This Answer Correct ? | 0 Yes | 0 No |
In what ways that Scala is healthier than different programming language?
Explain function currying in scala?
What does map in scala collection?
Difference between Array and List in Scala?
What is formula tail in scala?
How do I append data in a list?
Explain the use of tuples in scala?
How do I append to the list?
Is Scala an Expression-Based Language or Statement-Based Language? Is Java an Expression-Based Language or Statement-Based Language?
What is scala best used for?
What do you mean by a scala map?
What does listmap in scala?