Java basic Syntax (1)

Source: Internet
Author: User

1, the keyword: in fact, Java gives a word specific meaning.

2, reserved word: The predecessor of the keyword, but not yet ready to give meaning to the word.

3. identifiers: We give a particular meaning to a word by ourselves. (class name, variable name, function name)

  Note:1, number can not start

2, can not use keywords

4, constant : We will not be changed in the program amount. "Often" can be understood as the meaning of the normal, that is, a fixed posture.

5. Variables: An interval of memory, used to store data. Define variables when the data is uncertain or needs to be changed. (3 elements: The data type, the variable name, and the initialization value of the variable.) Scope: curly braces)

6. Data Type

1) Basic data type: Byte,short,int,long,float,double,char,boolean

2) Reference data type: arrays, classes, interfaces, (strings, strings can be attributed to classes in some sense)

Level from low to High: Byte,char,short (these three levels)-->int-->float--long-->double

Automatic type conversion: from low to high level, the system automatically turns.

Coercion type conversions: high-level data types to low-grade data types (data loss may occur)

7, Operation symbols:

1), Arithmetic operators

+-*/%/is the remainder,% is the provider, any integer%2 is not 0 is 1, so as long as the change is the divisor, you can realize the switch operation.

+: Connector

++,--

2), assignment operator

=,+, -=,*=,/= ,%=

3), Comparison operators

<,>,<=,>=

The result of this type of operator is either true or false

4), logical operators

&,|,^,!, &&,| |

Logical operator except! Unexpectedly, both links must be of type Boolean expression

Java basic Syntax (1)

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.