Java data type + escape character

Source: Internet
Author: User

A string is a class that belongs to a reference type.

The decimal default type is double, and it is sufficient to use float in development.

The integer default type is an int basic data type: similar to a normal value.

The Boolean type has only true and false values of two.

Reference data type: The address of the memory is passed

Floating-point types are actually decimals

Try to specify a specific value for each variable in development, and do not use the default value.

The double type can fit the entire universe of data.

Data overflow of type int:

A character type (char) occupies 2 bytes in memory and can be used to hold characters such as English letters. When a computer handles a character type, it treats the characters as a different whole, so the character type is also considered to be an integer type. For example:

such as: Char ch1= ' \ '; Represents a "

char ch2= ' \ \ '; Represents a \

System.out.println ("\" Hello world!\ ""); Output "Hello world!"

Data conversion:

Automatic type conversion: 1. Two types compatible 2. Small Turn-Large

Forced type conversion: Large turn small, front plus "(data type to convert)"

Any type of data is transformed to string

The operations between the byte types are first converted to int, and in the operation, the result is then converted to the byte type.

Java data type + escape character

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.