Obtained analogues syntax constructs for generic methods in Java and Kotlin:
public <T> void method() {}
fun <T> method() {}
public <T> T method(T... p) { return p[0]; }
fun <T> method(vararg p: T): T? { return p[0] }
public <T extends ClassA> T method(T[] p) { ... }
fun <T : ClassA> method(p: Array<T>): T { ... }
public <T extends ClassA & InterfaceA> T method(T[] p) {}
fun <T : ClassA> method(p: Array<T>): T where T : InterfaceA {}
public void method(Collection<? extends ClassA> collection) {}
fun method(collection: Collection<out ClassA>) {}
public void method(Collection<? super ClassA> collection) {}
fun method(collection: Collection<in ClassA>) {}
public void method(Collection<?> collection) {}
fun method(collection: Collection<*>) {}
Are there any other additional differences (syntactically or conceptual) for generalized methods in Java and Kotlin? Or innovations for generic methods in Kotlin? Thanks for any answer.
@JvmSuppressWildcards.