Skip to content

Instantly share code, notes, and snippets.

@Temidtech
Created April 23, 2018 13:58
Show Gist options
  • Save Temidtech/3a71fc8399bfa701528131e0e4ec8549 to your computer and use it in GitHub Desktop.
Save Temidtech/3a71fc8399bfa701528131e0e4ec8549 to your computer and use it in GitHub Desktop.
// Calling Java code from Kotlin
class KotlinClass {
fun kotlinDoSomething() {
val javaClass = JavaClass()
javaClass.javaDoSomething()
println(JavaClass().prop)
}
}
==================================
// Calling Kotlin code from Java
public class JavaClass {
public String getProp() { return "Hello"; }
public void javaDoSomething() {
new KotlinClass().kotlinDoSomething();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment