Java数值转化为二进制、十进制、十六进制字符串
int i = 123;
String binStr = Integer.toBinaryString(i); String otcStr = Integer.toOctalString(i); String hexStr = Integer.toHexString(i); String str = Integer.toBinaryString(i); String reverseStr = new StringBuilder(str).reverse().toString(); if (reverseStr.charAt(0) == '1') { System.out.println('True') }