What is a companion object
1 min readSep 21, 2020
A companion object holds variables and values that belong to all instances of the class they are inside of. All instances of the class can access and change these companion object variables.
A companion object holds variables and values that belong to all instances of the class they are inside of. All instances of the class can access and change these companion object variables.