我如何能夠在散列內創建散列,並且嵌套散列具有用於標識它的鍵。另外,我在嵌套哈希創建的元素,我怎麼能對他們有鍵以及如何在散列內創建散列
例如
test = Hash.new()
#create second hash with a name?? test = Hash.new("test1")??
test("test1")[1] = 1???
test("test1")[2] = 2???
#create second hash with a name/key test = Hash.new("test2")???
test("test2")[1] = 1??
test("test2")[2] = 2??
謝謝
歡迎來到SO。如果Joel回答了您的問題,請點擊答案旁邊的複選標記,將其標記爲選定的答案。 – pcg79