Last active
April 19, 2019 15:31
-
-
Save StylingAndroid/eca8952c9568a5d415e19040c6907cf1 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
fun main() { | |
val classOne = ClassOne() | |
val classTwo = ClassTwo() | |
classTwo.myFunc(true, classOne::doSomething) | |
} | |
class ClassOne { | |
private val output = "Hello, world!!!" | |
fun doSomething() { | |
println(output) | |
} | |
} | |
class ClassTwo { | |
fun myFunc(someCondition: Boolean, funcRef: () -> Unit) { | |
if (someCondition) { | |
funcRef() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment