62,628
社区成员
发帖
与我相关
我的任务
分享
public boolean equals(Object obj) {
return (obj instanceof Double)
&& (doubleToLongBits(((Double)obj).value) ==
doubleToLongBits(value));
}/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package exp1;
/**
*
* @author szhu5
*/
public class Test
{
public static void main(String args[])
{
Float g = new Float(4.2F);
Double d = new Double(4.2F);
System.out.println(d.equals(g));
}
}