Objects and Companion Objects

Singleton.

A singleton class is a class that is defined in such a way that only one instance of the class can be created and used everywhere.

A singleton class in Kotlin is a complimentary object class. It can be used on every classes and works with the concept of inheritance.

How to create a singleton Class? Create new class → Select Object.

Companion Objects.

A companion objects is written within any class. And also, everything that is written inside the companion object will be basically visible to other classes.

Reference:

Kotlin Newbie To Pro - OBJECTS AND COMPANION OBJECTS - Part 25
https://www.youtube.com/watch?v=2XnDq5pyJcI