慕粉0643035488
2016-12-15 23:49
package com.imcok;
public class shouji {
double size;
String cpu;
String memory;
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
shouji other = (shouji) obj;
if (cpu == null) {
if (other.cpu != null)
return false;
} else if (!cpu.equals(other.cpu))
return false;
if (memory == null) {
if (other.memory != null)
return false;
} else if (!memory.equals(other.memory))
return false;
if (Double.doubleToLongBits(size) != Double
.doubleToLongBits(other.size))
return false;
return true;
}
}
没有啊,正常比较的啊
你在前面是不是去调用了这个size
Java入门第二季 升级版
530653 学习 · 6091 问题
相似问题