package com.sf._09_object;

public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student student = new Student("zhangsan",10);
        Student student1 = new Student("zhangsan",10);

        Student cloneObj = (Student) student1.clone();

        System.out.println("克隆对象的名字:"+ cloneObj.getName());
        // getClass -> 后面再讲反射会用到
        System.out.println(student.getClass());

        // 计算hashCode 值 默认是根据对象地址计算
        System.out.println(student.hashCode());
        System.out.println(student1.hashCode());


        // 比较对象内容是否相同 前提你必须要重写object 当中equlas方法
        System.out.println(student.equals(student1));
        // 比较地址
        System.out.println(student==student1);
    }
}
