키(Key)와 값(value)이 짝으로 저장되는 데이터 타입을 말한다.
예
Ruby
>> person = {:name => "Hong Gil Dong", :phone_number => "(02) 123-4567"}
=> {:phone_number=>"(02) 123-4567", :name=>"Hong Gil Dong"}
>> person[:name]
=> "Hong Gil Dong"
>> person[:phone_number]
=> "(02) 123-4567"
>> person = {:name => "Hong Gil Dong", :phone_number => "(02) 123-4567"}
=> {:phone_number=>"(02) 123-4567", :name=>"Hong Gil Dong"}
>> person[:name]
=> "Hong Gil Dong"
>> person[:phone_number]
=> "(02) 123-4567"
'STUDY > Programming' 카테고리의 다른 글
| 해시(Hash)란? (0) | 2011/03/05 |
|---|---|
| codesearch (0) | 2006/11/16 |
| 썬마이크로시스템즈, 자바소스코드에 GPL 적용 (0) | 2006/11/15 |
