Created
October 10, 2010 09:55
-
-
Save KentaroArai/619116 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
// g100pon #4 マップ操作(基礎編:CRUD系操作とイテレーション) | |
def map = [atami:"onsen", hokkaido:"ski", price:100] | |
// atamiを読む | |
println map.get("atami") | |
// hokkaidoを更新 | |
map["hokkaido"] = "kani" | |
println map.get("hokkaido") | |
// hokkaidoを削除 | |
map.remove("hokkaido") | |
println map.containsKey("hokkaido") | |
// iteration | |
map.each {println it} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment