logo
  • 教程列表
  • SO官方文檔
  • 科特林的迴圈
    • 迴圈遍歷 iterables
    • 重複一次動作 x 次
    • 休息並繼續
    • 迭代 kotlin 中的地圖
    • 遞迴
    • 迴圈時
    • 用於迭代的功能構造
  1. StackOverflow 文件
  2. Kotlin 教程
  3. 科特林的迴圈
  4. 迭代 kotlin 中的地圖

迭代 kotlin 中的地圖

Created: November-22, 2018

//iterates over a map, getting the key and value at once

var map = hashMapOf(1 to "foo", 2 to "bar", 3 to "baz")

for ((key, value) in map) {
    println("Map[$key] = $value")
}
  • 遞迴
  • 休息並繼續

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明