Last active
October 9, 2017 09:38
-
-
Save agonist/278e674d5338e9a42d109b265b2d4532 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
class KotlinClass { | |
// here foo is declared as not nullable (nullable declaration would have been fun makeItCrash(foo: String?) | |
fun makeItCrash(foo: String) { | |
} | |
} |
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
public class Main { | |
public static void main(String[] args) { | |
KotlinClass kotlinClass = new KotlinClass(); | |
kotlinClass.makeItCrash(null); | |
// AndroidStudio only warns you, but you will get an IllegalArgumentException during execution | |
// if you pass a null value from Java code to a non-nullable Kotlin method parameter. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment