Here you can find the source of asHex(int val)
Parameter | Description |
---|---|
val | the value |
public static String asHex(int val)
//package com.java2s; //License from project: Open Source License public class Main { /** Hex string prefix. */ private static final String OX = "0x"; /**/* ww w. ja v a 2 s. c o m*/ * Returns a hex string representation of the given long value. * * @param val the value * @return a string representing the value in hex */ public static String asHex(long val) { String h = Long.toHexString(val); return OX + h; } /** * Returns a hex string representation of the given int value. * * @param val the value * @return a string representing the value in hex */ public static String asHex(int val) { String h = Integer.toHexString(val); return OX + h; } }