public class ObjectClass {
public static void main(String[] args) {
Demo dm = new Demo();
Object obj = dm.getObject();
System.out.println("Class name :: "+obj.getClass());
System.out.println("To String " + dm.toString());
System.out.println("HashCode "+ dm.hashCode());
}
}
输出
Class name :: class newTopic.Object.Demo
To String :: newTopic.Object.Demo@2a139a55
HashCode :: 705927765
那Demo@2a139a55和hascode 705927765有什么区别