https://kotlinlang.org logo
#announcements
Title
# announcements
d

Dalinar

04/09/2017, 2:38 AM
@bmsantos thanks, but what I meant is of that class exactly like from the question:
qux.getClass().equals(Foo.class)
, was just wondering if there was a simpler way in Kotlin - i guess something like
qux.javaClass === Foo::javaClass
is the shortest it can be - but I'm confused if it should be
===
or
==
. I guess from the java code, it should be
==
(update: nope, that doesn't work - see reply thread)
b

bmsantos

04/09/2017, 2:52 AM
My guess is that
==
is class loader safe and
===
is not.
d

Dalinar

04/09/2017, 2:54 AM
yes I was thinking that too, thanks - ok i'll go with
==
doesn't seem to work for me
==
or
===
- this is the best I could do that works
qux.javaClass === Foo::class.java
or
qux.javaClass.name == Foo::class.qualifiedName
2 Views