Hi, I saw a `kt` file with an `object` inside an `...
# getting-started
n
Hi, I saw a
kt
file with an
object
inside an
object
. I would like to know if someone can help me to understand the difference between using the
object
and a
companion object
. Is this the right way to use
object
?
Copy code
object Type {
    object USER {
        const val KEY  = "key"
        const val NAME  = "name"
    }
}
a
Hi Nuno, your example looks OK to me as a way of using `object`s to organise constant values, so that you can easily access them using IDE autocompletion as
Type.User.KEY
. Details about
object
declarations can be found here.
👀 1
n
Thanks 🙂
👍🏼 1