1 Star 0 Fork 0

ThisYoung/OnJava8-Examples

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
EqualsMethod2.java 483 Bytes
Copy Edit Raw Blame History
Bruce Eckel authored 2016-12-31 09:23 +08:00 . Date change
// operators/EqualsMethod2.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// Default equals() does not compare contents
class Value {
int i;
}
public class EqualsMethod2 {
public static void main(String[] args) {
Value v1 = new Value();
Value v2 = new Value();
v1.i = v2.i = 100;
System.out.println(v1.equals(v2));
}
}
/* Output:
false
*/
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/thisyoung/OnJava8-Examples.git
git@gitee.com:thisyoung/OnJava8-Examples.git
thisyoung
OnJava8-Examples
OnJava8-Examples
master

Search