Created
June 8, 2020 08:01
-
-
Save adryanev/9a10be765c52d6cc4e2f7a00b1a95ccd to your computer and use it in GitHub Desktop.
Operator Akses Indeks di 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 OperatorIndeks { | |
companion object{ | |
@JvmStatic | |
fun main(args: Array<String>) { | |
val bilangan = arrayOf(1,15,36,131,555) | |
//get [i] | |
println("Elemen di indeks 2 adalah ${bilangan[2]}") | |
//set [i] | |
bilangan[0] = 0 | |
println("Elemen di indeks 0 adalah ${bilangan[0]}") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment