Conversion issues in Java

Source: Internet
Author: User

1. Binary conversion

Decimal can be converted to other mechanisms: binary, 8 binary, 16 binary
public static String tobinarystring (int i): binary
public static String tooctalstring (int i): octal
public static String tohexstring (int i): hexadecimal
Convert decimal to other binary
public static String toString (int i, int radix)

Description: Converting additional binary 10 binary string s:s must be a numeric string
public static Integer ValueOf (String s, int radix)

Integer (String str): If the string is not a numeric string, an exception occurs:

NumberFormatException: Numeric Formatting exception

650) this.width=650; "title=" Binary conversion 1.png "style=" Float:none; src= https://s5.51cto.com/wyfs02/M01/9D/15/ Wkiom1l5wccqmuhhaaianwyhzum657.png-wh_500x0-wm_3-wmp_4-s_1251268589.png "alt=" Wkiom1l5wccqmuhhaaianwyhzum657.png-wh_50 "/>

650) this.width=650; "title=" Binary conversion 2.png "style=" Float:none; src= https://s5.51cto.com/wyfs02/M01/9D/15/ Wkiol1l5wcdwoakpaaecdeafone985.png-wh_500x0-wm_3-wmp_4-s_1303752062.png "alt=" Wkiol1l5wcdwoakpaaecdeafone985.png-wh_50 "/>

Common methods in 2.character:
public static Boolean isdigit (char ch) determines whether the specified character is a number.
public static Boolean islowercase (char ch) determines whether the specified character is a lowercase letter.
public static Boolean isuppercase (char ch) determines whether the specified character is uppercase
public static char toLowerCase (char ch): Converts characters to lowercase
public static char touppercase (char ch): Converts characters to uppercase

Conversion issues in Java

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.