返回一个对象的哈希码值。
用法:
话不多说上代码!!!
package cn.tedu.object;
/*
hashcode()方法:
*/
public class Test01 {
public static void main(String[] args) {
//返回对象的哈希码值
System.out.println(new Object().hashCode());
System.out.println(new Object().hashCode());
System.out.println(new Object().hashCode());
System.out.println(new Object().hashCode());
}
}
代码运行结果:
注意:每个对象返回的哈希码值都不一样!
本文地址:https://blog.csdn.net/myban/article/details/108022385
如对本文有疑问, 点击进行留言回复!!
关于在IDEA中SpringBoot项目中activiti工作流的使用详解
视频编辑工具ACDSee Luxea Video Editor安装及激活图文教程
java spring整合junit操作(有详细的分析过程)
网友评论