package ch07_01;
public class ObjectTest {
	public static void main(String[] args) {
		ObjectTest a=new ObjectTest();
		System.out.println("a对象所属于的类为："+a.getClass());
		System.out.println("a对象的哈希码值为："+a.hashCode());
		System.out.println("a对象的toString（）方法返回值为："+a.toString());
		ObjectTest b=new ObjectTest();
		System.out.println("b对象所属于的类为："+b.getClass());
		System.out.println("b对象的哈希码值为："+b.hashCode());
		System.out.println("b对象的toString()方法返回值为："+b.toString());
		String xyz="利用equals方法判断两个对象a、b是否相等的结果：";
		System.out.println(xyz+a.equals(b));
		System.out.println("利用==判断两个对象a、b是否相等的结果："+a.equals(b));
		String s1=new String("abc");
		String s2=new String("abc");
		String s3="123";
		String s4="123";
		System.out.println("s1==s2结果为"+(s1==s2));
		System.out.println("s1.equals(s2)结果为:"+(s1.equals(s2)));
		System.out.println("s3==s4结果为"+(s3==s4));
		System.out.println("s3.equals(s4)结果为:"+(s3.equals(s4)));
	}
}