Need Assistance?

support@tutorialshub.in

Object-Oriented Programming in Kotlin

object Singletons & companion object

ADVERTISEMENT
Kotlin Free Lesson
5 min read
ADVERTISEMENT

Create a thread-safe Singleton in one keyword using object ApiClient { ... }, and replace Java's static methods with a companion object inside a class.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you