package sample.sample19;

public class Person {
	private String name;

	private String address;

	private String tel;

	public Person(String name, String address, String tel) {
		this.name = name;
		this.address = address;
		this.tel = tel;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Override
	public boolean equals(Object obj) {
		Person p = (Person) obj;
		if (this.name.equals(p.name) == false) {
			return false;
		}
		if (this.address.equals(p.address) == false) {
			return false;
		}
		if (this.tel.equals(p.tel) == false) {
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		return name.length();
	}

}
