The following code in kotlin:
Any().javaClass
Has value of java.lang.Object
. Does that mean Any
and Object<
Kotlin compiler treats kotlin.Any
and java.lang.Object
as two different types, but at runtime they are represented with the same java.lang.Object
class.
javaClass
property returns the runtime class of an instance, so that's why you get the same java.lang.Object
class in both cases.
There are also other types which are different at compile time, but the same at runtime; they are listed in the Mapped types section of the documentation.