Online Java Compiler By
JavaTpoint.com
public class Double_doubleToLongBitsMethod_Example3 { public static void main(String[] args) { //passing negative value double d1=-65876856.6756756; Double_doubleToLongBitsMethod_Example3 obj = new Double_doubleToLongBitsMethod_Example3(); //Converting negative double to long Bits Double d2= Double.doubleToLongBits(d1); System.out.println(d1+" value in long bits = "+d2); } }
Output