package own.crazyit06.chapter2;

/**
 * Description:
 * <br/>Copyright (C), 2005-2008, Yeeku.H.Lee
 * <br/>This program is protected by copyright laws.
 * <br/>Program Name:
 * <br/>Date:
 * @author  Yeeku.H.Lee kongyeeku@163.com
 * @version  1.0
 */
 
//¶¨ÒåÒ»¸öPersonÀà
class Person1
{
	//ÖØÐ´equals·½·¨£¬Ìá¹©×Ô¶¨ÒåµÄÏàµÈ±ê×¼
	public boolean equals(Object obj)
	{
		//²»¼ÓÅÐ¶Ï£¬×ÜÊÇ·µ»Øtrue£¬¼´Person¶ÔÏóÓëÈÎºÎ¶ÔÏó¶¼ÏàµÈ
		return true;
	}
}
//¶¨ÒåÒ»¸öDog¿ÕÀà
class Dog{}
public class OverrideEqualsError
{
	public static void main(String[] args) 
	{
		Person1 p = new Person1();
		System.out.println("Person¶ÔÏóÊÇ·ñequals Dog¶ÔÏó£¿" + p.equals(new Dog()));
		System.out.println("Person¶ÔÏóÊÇ·ñequals String¶ÔÏó£¿" + p.equals(new String("Hello")));
	}
}
