Java Integer to Hex IntToHexString(final int value)

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

Description

Int To Hex String

License

Creative Commons License

Declaration

public final static String IntToHexString(final int value) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    public final static String IntToHexString(final int value) {
        final String string = Integer.toString(value, 16).toUpperCase();

        if (string.charAt(0) == '-') {
            return "-0X" + string.substring(1, string.length());
        } else {/*  w w w.  j  a v a 2s . com*/
            return "0X" + string;
        }
    }
}

Related

  1. intToHexChar(int i)
  2. intToHexChars(int n)
  3. intToHexLE(int val)
  4. intToHexStr(int i, int len)
  5. intToHexStr(int src, int len, int code)
  6. intToHexString(int _i)
  7. intToHexString(int i)
  8. intToHexString(int i)
  9. intToHexString(int i)