tipsy
09/14/2018, 7:40 PMDouble.javaClass // DoubleCompanionObject ?
Double::class.java // java Double ?
Double // kotlin Double ?
and when to use which?Shawn
09/14/2018, 8:17 PMDouble on its own (not used as a type annotation) will refer to Double’s companion object (of which I don’t think there is one)Shawn
09/14/2018, 8:18 PMDouble::class will yield a KClass<Double>Shawn
09/14/2018, 8:19 PM.javaClass should be used when you need the Java Class<T> of an instantiated objectShawn
09/14/2018, 8:20 PMDouble::class.java should be used when you need a reference to the Class<T> by way of knowing the name of the classShawn
09/14/2018, 8:23 PMtipsy
09/14/2018, 8:55 PM