Foo.Companion.getBar1() const val bar2: Int Foo.bar2 @JvmStatic Foo.getBar3() val bar3: Int Foo.Companion.getBar3() @JvmField val bar4: Int Foo.bar4 @JvmStatic Foo.baz() fun baz(): Unit Foo.Companion.baz() } }
final int getBar() String getBaz() void setBaz(String) int component1() String component2() Foo copy(int, String) String toString() int hashCode() boolean equals(Object) Data class
bar: Int, var baz: String) : Parcelable static class Creator implements android.os.Parcelable.Creator static android.os.Parcelable.Creator CREATOR = new Foo.Creator(); int describeContents() void writeToParcel(Parcel, int) Data class
1 int foo(); } static final class DefaultImpls { static int foo(Foo $this) { return 1; } } } class Bar : Foo class Bar implements Foo { int foo() { return Foo.DefaultImpls.foo(this); } } Interface
invoke(): R } interface Function1<in P1, out R> : Function<R> { operator fun invoke(p1: P1): R } …. interface Function22<in P1, in P2,… in P22> : Function<R> @SinceKotlin("1.3") interface FunctionN<out R> : Function<R>, FunctionBase<R> { operator fun invoke(vararg args: Any?): R override val arity: Int } Lambdas
Int) -> Unit getBar().invoke(int, int, int) val baz: String.(Int) -> Unit getBaz().invoke(String, int) val qux: (Int, … Int) -> Unit getQux().invoke(1, "2", new Random(), null) Lambdas
} // $FF: synthetic method public Foo(DefaultConstructorMarker) { this(); } } class Bar : Foo() final class Bar extends Foo { public Bar() { super((DefaultConstructorMarker)null); } } Sealed class