Java Hex Print printHexNumber(int n)

Here you can find the source of printHexNumber(int n)

Description

Returns number in 0xABCDEF-Format

License

Open Source License

Parameter

Parameter Description
n a parameter

Declaration

public static String printHexNumber(int n) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from ww w .j av a2  s  .  com
     * Returns number in 0xABCDEF-Format
     *
     * @param n
     * @return
     */
    public static String printHexNumber(int n) {
        return "0x" + Integer.toHexString(n).toUpperCase();
    }
}

Related

  1. printHex(byte[] bytes)
  2. printHex(byte[] data)
  3. printHex(byte[] field, int start, int len)
  4. printHexa(final byte b)
  5. printHexBytes(byte[] _theBytes)
  6. printHexString(byte[] b)
  7. printHexString(final StringBuilder sb, final String hexData)