-
-
Save PatilShreyas/f9ca8adabc3b702427d0898749b3180e 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
interface Predicate { | |
fun isTrue(): Boolean | |
} | |
fun main() { | |
val predicate = object: Predicate { | |
override fun isTrue() = 10 == (5*2) | |
} | |
println(predicate.isTrue()) // prints "true" | |
} |
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 interface Predicate { | |
fun isTrue(): Boolean | |
} | |
fun main() { | |
val predicate = Predicate { 10 == (5*2) } | |
println(predicate.isTrue()) // prints "true" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment