In java, the conversion between hexadecimal (decimal to hexadecimal, decimal to binary, binary to decimal, and binary to hexadecimal)

Source: Internet
Author: User
Tags binary to decimal decimal to binary

[Java] // convert hexadecimal to hexadecimal Integer. toHexString (20); // convert toHexString to binary Integer. toBinaryString (10); // hexadecimal to hexadecimal Integer. parseInt ("10", 16); // returns a hexadecimal Integer in hexadecimal notation. toHexString (20); // convert toHexString to binary Integer. toBinaryString (10); // hexadecimal to 10 hexadecimal www.2cto. comInteger. parseInt ("10", 16); [java] view plaincopyprint? // Another common method is BigInteger bigInt = new BigInteger (str, int1); System. err. println (bigInt. toString (int2); // Where str is the string to be converted, int1 is the base of str, and int2 is the base to be converted

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.