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.
解决方案 »
- javax.naming.NameNotFoundException: Name ds is not bound in this Context
- 为什么我的这段代码没有输出结果啊
- 若抽象类没有抽象方法要怎么继承?
- 求求求求。。。。。求求求求助。。。。
- java解析文本文件数据并保存入库的问题!
- vc++与java通讯的中文问题如何解决?(100分)
- AWT套件中有没有类似messagebox的功能!
- JCreator 有汉化版本吗?
- 为什么在try...catch块中定义的局部变量不能被。。。
- 有谁用过java写过游戏?
- ibm 的 xml parser 如何使用?
- netscape.softupdate.Trigger有问题,怎么解决??
你的Value类缺省继承Object,所以equals比较对象地址,而Integer类复写了equals方法,它是按照包装在里面的int数值进行比较的。