Created
June 8, 2020 07:18
-
-
Save adryanev/b9ae9b1b8b641b2779058ff5108730e3 to your computer and use it in GitHub Desktop.
Operator Logika pada Kotlin
This file contains hidden or 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
package operator_casting | |
class OperatorLogika { | |
companion object{ | |
@JvmStatic | |
fun main(args: Array<String>) { | |
val a = 10 | |
val b = 9 | |
val c = -1 | |
var result: Boolean | |
//and | |
result = (a>b) && (a>c) // result = (a>b) and (a>c) | |
println("($a > $b) and ($a > $c) = $result") | |
//or | |
result = (a<b) || (a>c) // result = (a<b) or (a>c) | |
println("($a < $b) or ($a > $c) = $result") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment