SHARE
TWEET

Untitled

a guest Aug 25th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun main(args: Array<String>) {
  2.     val a : MutableMap<Int, String> = mutableMapOf(1 to "ねこ")
  3.     a.put(2 , "いぬ")                //追加
  4.     println("${a[1]} ${a[2]}")       //そのまま表示
  5.    
  6.     a.remove(1)                      //ここで「ねこ」を削除
  7.    
  8.     val a1 = a[1]                    //キーに新しい変数を付ける
  9.     val a2 = a[2]                    //同様
  10.     println(a1 +" " + a2)            //変数での表示方法
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top