Get the hexadecimal string representation

static String toHexString(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
Home 
  Java Book 
    Essential Classes  

Double:
  1. Double class
  2. Constants in Double class
  3. Double class Constructor
  4. Return double value as byte, double, float, int, long, short
  5. Compare two double values
  6. Is a double value an infinite large value, or it is not a number.
  7. Convert string value to double
  8. Convert double value from string
  9. Get the hexadecimal string representation
  10. Bit oriented calculation for double type