3
私はClass
パラメータを受け入れるJavaメソッドを持っています。私はそれにInteger.class
を渡す必要がありますが、Kotlinコードから。私はInt::class.java
を試しましたが、int.class
が関数に渡されるため、これは機能しません。私の質問は、コトルからInteger.class
にアクセスするにはどうすればいいですか?KotlinからInteger.classにアクセス
のJava
void foo(Class clazz);
Kotlin
foo(Int::class.java) // does not work, int.class gets passed to foo
(https://stackoverflow.com/questions/45397859/whats-the-behavior-of-iterableall-why- did-kotlin-charclass-java-char-ja/45400025#45400025)。 –