package Chap13;
import java.util.*;
/*
 * ÀÛ¼ºÀÏÀÚ:2017_03_16
 * ÀÛ¼ºÀÚ:±æ°æ¿Ï
 * HashMap Å¬·¡½ºÀÇ »ç¿ë ¿¹¸¦ º¸¿©ÁÖ´Â ÇÁ·Î±×·¥(2)
 * ¿¹Á¦ 13-12
 * ¿¹Á¦ 13-13: Name Å¬·¡½º¿¡ ´ëÇØ hasCode ¸Þ¼Òµå¸¦ È£ÃâÇÏ´Â ÇÁ·Î±×·¥
 */
public class HashMapExample2 {
	public static void main(String[] args){
		HashMap<Name,Integer> hashtable = new HashMap<Name,Integer>();
		hashtable.put(new Name("ÇØ¸®", "Æ÷ÅÍ"),new Integer(95));
		hashtable.put(new Name("Çì¸£¹Ì¿Â´À","±×·¹ÀÎÁ®"),new Integer(100));
		hashtable.put(new Name("·Ð","À§Áñ¸®"),new Integer(85));
		hashtable.put(new Name("µå·¹ÀÌÄÚ","¸»Æ÷ÀÌ"),new Integer(93));
		hashtable.put(new Name("³×ºô","·Õ¹ÙÅÒ"),new Integer(70));
		Integer num = hashtable.get(new Name("Çì¸£¹Ì¿Â´À","±×·¹ÀÎÁ®"));
		System.out.println(num);
		
		Name obj1 = new Name("Çì¸£¹Ì¿Â´À","±×·¹ÀÎÁ®");
		Name obj2 = new Name("Çì¸£¹Ì¿Â´À","±×·¹ÀÎÁ®");
		int hash1 = obj1.hashCode();
		int hash2 = obj2.hashCode();
		System.out.println(hash1);
		System.out.println(hash2);
	}
}
