How to get a java.lang.Class


#1

Sorry for the dumb question :)

How to get a java.lang.Class in Kotlin?

In Java (for example, class “User”), is written as:  User.class

In Scala: classOf[User]



As it is written in Kotlin?


#2

You can write: javaClass<User>()

or (for instances):
u.javaClass