Java base escape character, data type

Source: Internet
Author: User

One, escape character

1, \ n

\ nthe function is to wrap, which is the same as the ENTER key on the keyboard

2, \ t

The role of \ T is to watch, that is, eight spaces for a unit, when less than eight will be automatically filled eight, such as ASD\TFGH, then the output will be.

3, \ r

The function of \ r is to replace, with the back of the replacement of the front, such as 123456\r789, then output 789456, if the \ r after the unit more than the previous, such as 123\r456789, then output 456789.

4, \ ' and \ ' and \ \

The three kinds of effects, you can print out the corresponding ' or ' or \

First, the data type

1, first said memory, memory is in every computer has, his speed can reach a few g per second, there are many units in memory, and a unit represents a byte. When used for convenience, does not cause confusion, where Java (and other programming languages) divides them into several packages, that is, the type of data that will be said, with these data types, the operation is more efficient.

2. Classification of data types

Here is a bit, bit is the smallest count unit, only 0 and 1, the conversion relationship is as follows:

A, a byte about how much data can be stored?

A, Boolean type, and char type

1. Boolean type

The Boolean type is only 0 and 1, where 0 means false,1 represents true

2. Char type

Char is a 16-bit range that is 0~65535, because Char has no negative numbers, and char stores characters, so it is called a character type. The memory is binary, but when converted into characters, it is necessary to convert the character representation.

The flowchart for generating characters is as follows:

Java base escape character, data type

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.