Java Base language

Source: Internet
Author: User

1,java keywords: goto and const are reserved keywords and are not implemented in Java. True false and Null are special literal values that, technically speaking, are not Java keywords.

2, identifier: Is the word we use in Java code.

⑴, identifiers cannot be keywords or true,false,null.

⑵, identifiers can contain letters, numbers 0-9, underscores (_), or dollar signs ($).

⑶, the first character of an identifier must be a letter, an underscore (_), or a dollar sign ($).

⑷, identifiers are of a different size, and no maximum length is specified.

3, data type: The Java language itself contains eight data types, and these eight data types, called basic types, are the basic construction units for creating classes.

Eight basic types of Java:

⑴ integer: ①byte (Size: 1 bytes, 8 bits)

②short (Size: 2 bytes, 16 bits)

③int (Size: 4 bytes, 32 bits)

④loog (Size: 8 bytes, 64 bits)

⑵ Float Type: ⑤float (Size: 4 bytes, 32 bits)

⑥duoble (Size: 8 bytes, 64 bits)

⑶ character type: ⑦char (Size: 2 bytes, 16 bits)

⑷ Boolean type: ⑧boolean (size: indeterminate, determined by the JVM)

Reference type: ① classes: Class

② Interface: INTCRFACC

③ Array

4, variables: variables are used to store data.

5, when performing mathematical expression operations in Java, there are the following automatic type hint rules:

⑴ all of the byte type, short and char types will be promoted to the int type;

⑵ if one of the operands is a long type, the result is a long type;

⑶ if one of the operands is a float type, the result is a float type;

⑷ if one of the operands is of type double, the result is a double type.

Beyond the range of 32 bits of int type, this literal cannot be considered an int type. In this case, we must add an L to the literal to indicate that the literal must be stored in a long type.

6, escape character: ①\b, backspace, ②\t, tab, ③\n, newline, ④\r, enter, ⑤\ "double quote, ⑥\ ', single quote, ⑦\\, backslash.

7, constant: You can declare a variable as a constant (that is, the amount that cannot be changed).

8, Operator:

⑴ pre-or post-increment and decrement: ++,--;

⑵ unary operator: +,-,~,! (forced conversion);

⑶ multiplication, except, take surplus: *,/,%;

⑷ Plus, minus, string connection: +,-,+;

⑸ move operator:<<,>>,>>>;

⑹ comparison operator:<,<=,>,>=,instanceof;

⑺ equality operator: ==,! =

⑻ bitwise operator:&,|,^;

⑼ Conditions and,or:&&,| | ;

⑽ three-mesh operator:? : ;

⑾ assignment Operator: =;

⑿ Extended assignment operator:*=,/=,%=,+=,-=,<<=,>>=,>>>=,&=,^=,|=;

9,java Note: ⑴ with two forward slash//, single-line comment;

⑵ with/* */, multi-line comment;

⑶ with/** */javadoc comments.

Java Base language

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.