karelpeeters
06/19/2017, 2:46 PMdavid.bilik
06/19/2017, 2:47 PMkarelpeeters
06/19/2017, 2:55 PMfun main(args: Array<String>) {
val test = Test()
val runnable = Runnable { test.value = 5}
runnable.run()
}
class Test {
var value: Int = 3
set(value) {
print(value)
}
}
karelpeeters
06/19/2017, 2:56 PMdavid.bilik
06/19/2017, 3:05 PMrestioson
06/19/2017, 6:05 PMrestioson
06/19/2017, 6:05 PMmiha-x64
06/19/2017, 6:13 PMhughg
06/19/2017, 8:08 PMlucasas
06/19/2017, 8:47 PMdamian
06/19/2017, 9:00 PMlucasas
06/19/2017, 9:16 PMiex
06/19/2017, 9:49 PMiex
06/19/2017, 9:49 PMjw
06/19/2017, 10:05 PMiex
06/19/2017, 10:18 PMsherry.yuan
06/19/2017, 10:51 PMuser
06/19/2017, 10:56 PMA.NUMBER
, which is short for A.Companion.NUMBER
. If you name the companion object (e.g. companion object MyConstants
) the long-hand syntax would change to A.MyConstants.NUMBER
.user
06/19/2017, 10:59 PMuser
06/19/2017, 10:59 PMiex
06/20/2017, 1:12 PMjlleitschuh
06/20/2017, 2:41 PMmiha-x64
06/20/2017, 2:43 PMjlleitschuh
06/20/2017, 2:44 PMjlleitschuh
06/20/2017, 2:46 PMjlleitschuh
06/20/2017, 2:46 PMkarelpeeters
06/20/2017, 3:10 PMthis.getClass().getResource(...)
in a top-level Kotlin method? There is no class to point to...dalexander
06/20/2017, 3:11 PMthis::class.javaClass
might get you a reference?karelpeeters
06/20/2017, 3:12 PMthis
is not even defined as the method doesn't belong to a dalexander
06/20/2017, 3:14 PMThread.currentThread().contextClassLoader.getResource(...)