A

Admin • 828.03K Points
Coach

Q. What does the 'companion object' in Kotlin do?

  • (A) Creates static methods and properties
  • (B) Initializes variables
  • (C) Declares a singleton
  • (D) Overrides constructors
  • Correct Answer - Option(A)
  • Views: 4
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin
'companion object' is Kotlin’s way of declaring static-like properties and methods.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.