If not override equals(), for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true). Integer overrided equals() method, while Value didn't. So you have different results.
解决方案 »
- 实现 clone 方法时,为什么不能用 Object.clone() 而用 super.clone() ,super 不就是 Object 吗?
- 深入Java关键字null
- 能取得jLabel中的图像开始的坐标吗?
- 在写struts2出现的简单问题
- java新手,诚心求教!
- 同一个包内的两个类为什么无法正常调用?
- java
- jbuilder 6 开发的程序如何打包,如何脱离JBuilder环境运行
- 高手帮忙--HELP!HELP!HELP!!!
- 哪里有最新的JDK 下载?送分20!!
- ibm 的 xml parser 如何使用?
- netscape.softupdate.Trigger有问题,怎么解决??
你的Value类缺省继承Object,所以equals比较对象地址,而Integer类复写了equals方法,它是按照包装在里面的int数值进行比较的。