Java Chapter II Summary (data type, operator)

Source: Internet
Author: User
Tags arithmetic operators

First, high-level language composition

① data type ② variable ③ operator, expression, statement ④ identifier (System pre-defined and user-defined) ⑤ syntax rules

Second, naming norms

1. All uppercase letters of the constant letter

2. First capitalization of class name

3. Project Name lowercase

4. Variable name lowercase, followed by the first uppercase of a word

5. See the meaning of the name

6. Hump Naming method

Third, the data type

8 basic data types and reference data types

Reference data type such as String

Constant modifier final, such as final double PI = 3.14;

Basically the following:

Iv. Automatic data type conversion

Number default int, decimal default double

float A = 3.2F

Double b = 4.6D

Small turn large, automatic turn, big turn small, forced to short C = (short) 3.4

String connector +, directly add the string together, powerful link function

When executed sequentially, strings are added to the numbers, which are directly linked together. Number plus number, value added

V. Transfer characters (control format)

Commonly used is \ t, \ r \ n

Vi. operators

Operators are divided into arithmetic operators, logical operators, relational operators

Increment operator rule: ++i, symbol in front, first calculate after use, i++, symbol after, first use after calculate

Three-mesh operator?: expression 1? Expression 2: Expression 3 (1 established 2, otherwise 3)

Vii. common shortcut keys for Eclipse

alt+/Auto Association

Ctrl+d Delete a row

Ctrl+shift+c ctrl+/Comment One line or the selected

Ctrl+k to find the selection quickly

Ctrl+shift+f typesetting

Eight, numerical overflow processing

First convert to 10, then the complement to the original code (take the inverse plus one)

The highest bit is the sign bit, and the 0-bit +,1 is-

Negative number two-stage system representation method: positive negation in plus one

Java Chapter II Summary (data type, operator)

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.