Java Hex Calculate toHexString(final int value)

Here you can find the source of toHexString(final int value)

Description

Returns a string representation of the integer argument as an unsigned integer in base 16.

License

Open Source License

Parameter

Parameter Description
value the integer value

Return

the hex string representation

Declaration

public static String toHexString(final int value) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*w  w w.j a  v a2  s  .c o  m*/
     * Returns a string representation of the integer argument as an
     * unsigned integer in base 16. The string will be uppercase
     * and will have a leading '0x'.
     *
     * @param value the integer value
     *
     * @return the hex string representation
     */
    public static String toHexString(final int value) {
        return "0x" + Integer.toHexString(value).toUpperCase();
    }
}

Related

  1. toHexString(final byte[] data)
  2. toHexString(final byte[] data)
  3. toHexString(final byte[] fieldData)
  4. toHexString(final byte[] raw)
  5. toHexString(final int i)
  6. toHexString(final long num, final char paddingChar, int min, int max)
  7. toHexString(int b)
  8. toHexString(int b)
  9. toHexString(int bits, int value)