Get the hexadecimal string representation

ReturnMethodSummary
static StringtoHexString(double d)Returns a hexadecimal string representation of the double argument.

public class Main {
  public static void main(String[] args) {
    
    System.out.println(Double.toHexString(1.2));

  }
}

The output:


0x1.3333333333333p0
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.