package cn.itcast.hashcodeText.Demo;

import java.util.HashSet;
import java.util.Iterator;

import cn.itcast.hashcode.Demo.Person;

public class HashCode {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		HashSet hs=new HashSet();
		hs.add(new Person("aaa1",33));
		hs.add(new Person("aaa2",34));
//		hs.add(new Person("aaa3",35));
//		hs.add(new Person("aaa4",36));
		hs.add(new Person("aaa2",34));
		for(Iterator it=hs.iterator();it.hasNext();){
//			Person p=(Person)it.next();
//			System.out.println(p.getName()+":"+p.getAge());
			System.out.println(it.next());
		}
	}
	

}
