How to compare classes and interfaces? : <p>Can anybody explain me how to compare KClasse-s and interfaces among yourselves? I known how to check that classes or interfaces are equal but I don't understand how to check that A class is superclass of B class, etc.</p>

<pre><code>interface IB {}
interface IC : IB {}

open class A {}
open class B : A() {}
open class C : B(), IC {}

fun main(args: Array&lt;String&gt;) {
  if (B::class == B::class) { println("B class is equal to B class") }
  if (IB::class == IB::class) { println("IB interface is equal to IB interface") }

  if (A::class ??? B::class) { println("A class is parent of B class") }
  if (A::class ??? C::class) { println("A class is superclass of C class") }

  if (C::class ??? IC) { println("C class is implement IC interface") }
  if (IC ??? IB) { println("IC interface is implement IB interface") }
}
</code></pre>
