Java's Integer encapsulation class Integer and Long provide the toString (int I, int radix) static method, which can convert any hexadecimal Integer to another hexadecimal Integer.
Example:
Public class Main {public static void main (String [] args) {int numOct = 0123; // statement of the octal digit, add 0 to the Front) int numTen = 8888; // declaration of decimal numbers int numHex = 0 xabcd; // declaration of hexadecimal numbers, prefixed with 0x and Zero x) // convert binary, octal, and hexadecimal proprietary method System. out. println ("October 0123 is replaced with binary:" + Integer. toBinaryString (numOct); System. out. println ("decimal 8888 to decimal:" + Integer. toString (numTen); System. out. println ("hexadecimal 0xabcd to hexadecimal:" + Integer. toHexString (numHex); // You can also replace any hexadecimal integer with another hexadecimal number System. out. println ("hexadecimal 0xabcd to hexadecimal:" + Integer. toString (numHex, 7 ));}}
This article is from the blog of "Italian suckling pig", please be sure to keep this source http://lovesisi.blog.51cto.com/6414433/1301214