I
I
Igor-Novikov2020-04-23 09:52:05
Kotlin
Igor-Novikov, 2020-04-23 09:52:05

Why do you need to use the reference operator to get the class name?

I know that the reference operator is used as a function pointer

val b = ::a
//затем функцию а можно вызывать через 
b()


But why is this operator used in conjunction with the this keyword to get the name of a class?
this::class

in Java this is done simply through a dot and the getClass() method.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question