final String a; @NotNull public final String getA() { return this .a; } public NormalClass (@NotNull String a) { Intrinsics.checkNotNullParameter (a, "a"); super (); this .a = a; } } Kotlin class NormalClass( val a : String )
private final String a; @NotNull public final String getA() {/*(略)*/} public DataClass(@NotNull String a) {/*(略)*/} @NotNull public final String component1(){/*(略)*/} @NotNull public final DataClass copy(@NotNull String a) {/*(略)*/} @NotNull public String toString() {/*(略)*/} public int hashCode() {/*(略)*/} public boolean equals(@Nullable Object var1) {/*(略)*/} } data class DataClass( val a : String )
} /*(略)*/ public static final class Dog extends Animal { @NotNull public static final Animal.Dog INSTANCE; private Dog() {/*(略)*/} } public static final class Cat extends Animal { @NotNull public static final Animal.Cat INSTANCE; private Cat(){/*(略)*/} } } sealed class Animal { object Dog: Animal() object Cat: Animal() } Java Kotlin
KotlinHoge() public int a; private final transient int b; private volatile int c; public final synchronized void hoge() {} public final strictfp void piyo() {} public final void fuga() throws IOException {) @JvmStatic fun main(args: Array<String>) {} override @file:JvmName ("KotlinHoge" ) @JvmField var a : Int = 0 @Transient val b : Int = 0 @Volatile var c : Int = 0 @Synchronized fun hoge(){} @Strictfp fun piyo(){} @Throws(IOException:: class) fun fuga(){} Java Kotlin