char declaration in java

Discover char declaration in java, include the articles, news, trends, analysis and practical advice about char declaration in java on alibabacloud.com

Questions about the mutual assignment between Byte,short,char,int in Java

First, the range of values for these data classes is clarified:BYTE: -128~127Short: -2^15~2^15-1char:0~65536int: -2^31~2^31-1Take a look at the following code:byte B = 100;Short S = b; Correct, because the value range of byte is within the short value range.char C = b; Error because the value range of byte is not exactly within the value range of char.c = S; Error because the value range of short is not exactly within the value range of char.int x = b; Correct, because the value range of byte is

Operation operations in Java involving Byte, short, and char types

Operations in Java, which involve byte, short, and char types, first convert the values to the int type, then the int type value, and finally the result of the type int. So, if you add two byte values, you end up with the result of an int type. If you need to get a byte type result, you must explicitly convert the result of this int type to the byte type. For example, the following code will cause the compi

Total Pages: 6 1 2 3 4 5 6 Go to: Go

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.