Ayden
12/15/2019, 4:25 AMobject Constant {
URL = ""
}
OR
class Constant {
companion object {
URL = ""
}
}
pankajrai
12/15/2019, 5:59 AMsindrenm
12/15/2019, 4:44 PMclass Constant {
companion object {
const val URL = ""
}
}
And in both cases, usages of URL
will be inlined, as was mentioned. I agree, however, that using just a single object (object Constant
) here is better, there's no need for any wrapping class unless it should be possible to keep different individual instances of it around. 👍