Java Basics, etc.

Source: Internet
Author: User
Tags arithmetic operators bitwise operators logical operators

One, Java code comment

A single line of comments (//..... ...). ....... )

Multiline Comment (/*...................*/)

Document Comments (/**..............................*/

Single-line comment shortcut key ctrl+/

Second, operator

Unary operators

Binary operators

Ternary operators

Arithmetic operators

logical operators

Bitwise operators

Other operators

Arithmetic operators: + 、-、 *,/,% (take more)

Concatenation operator: + (String type)

Conversion operators

Gaga and decrement operators: + + 、--

Logical operator:! , &&, | |, = =, <, >, etc.

Trinocular operator: Code 1? Code Listing 2: Code 3

Displacement operator

Expression: A meaningful code consisting of at least one operand and at least one operator.

Characteristics of expressions: each expression has a return type

Each expression can be operated with other expressions as long as the type meets the requirements.

Precedence of operators:

Common scenarios for expression of multiple operators

1. Operation from left to right

2, the assignment of the expression, always in the last step

3, if there is a function call, the first function call, if the function call is a type conversion, then perform type conversion

4. Mathematical Operation rules

Java Basics, etc.

Related Article

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.