请教各位大神,为什么我代码中size跑到了最后去判断,而且是什么意思呀
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;
}
}