java.lang.Long.toHexString()%uA0方法返回下列字符作为十六进制数字long参数以基数为16的无符号整数的字符串表示形式:0123456789abcdef
声明
以下是java.lang.Long.toHexString()方法的声明
public static String toHexString(long i)
参数
-
i%uA0-- 这是一个long 转换为字符串。
返回值
此方法返回由十六进制的参数(以16为基数)为代表的无符号长整型值的字符串表示形式。
异常
-
NA
例子
下面的例子显示java.lang.Long.toHexString()方法的使用。
package com.yiibai import java.lang.* public class LongDemo { public static void main(String[] args) { long l = 220 System.out.println("Number = " + l) /* returns the string representation of the unsigned long value represented by the argument in hexadecimal (base 16) */ System.out.println("Hex = " + Long.toHexString(l)) } }
让我们来编译和运行上面的程序,这将产生以下结果:
Number = 220 Hex = dc