Created
April 23, 2018 13:58
-
-
Save Temidtech/3a71fc8399bfa701528131e0e4ec8549 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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