Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
JAVA rules for identifiers
- Identifier made up of letters, numbers, underscores and $, of which the numbers do not begin with
- Java keywords and identifiers can be reserved words, but can contain keywords and reserved words, can not be used as true, false and null, etc.
- Identifiers can not contain spaces and @, #, and other special characters
Java keywords
Java keywords are all lowercase, TRUE, FALSE, and NULL is not a Java keyword
Which goto and const is a reserved word (Java we have not yet using these keywords, you may use in the future)
Java language support types are divided into: basic type (boolean types and value types) and reference types (to an object (instances and arrays) references)
- Converted into a binary integer decimal number: 1 to give reduced anti-complement code, the inverted sign bit unchanged, the other bit inversion to obtain the original code
- To a range of 0 to 65535 int char type variable is assigned the integer, the system will automatically int char types integer treated as
- char type single quotes single character string enclosed in double quotes
- When there are two \\ default escape character is first, second is the actual backslash
- floating point type double precision floating point higher than the float type
- Float and double negative infinity and positive infinity equally large, 0.0 divided by 0.0 the number of non-appearance, between two non-unequal, negative, negative infinity divided by 0.0 to obtain
- Left of the arrow numeric type can be automatically converted into a numerical type right arrow
- + Not only as the addition operator, it may also be used as string concatenation
- The string can not be converted directly into a base type, the use of the Integer.parseInt () method will be converted into a string of type int
- / Division operator, if both operands are integers, is the natural result of the division rounded truncated (19/4 = 4); 0.0 positive integer obtained by dividing the positive infinity, negative integer by 0.0 to obtain a negative infinity
- % Remainder operation has two operands in a floating point or two are, modulo the number of non-results; any number of remainder other than 0 or 0 to 0.0 or 0.0 are obtained 0, 0 of a remainder obtained NaN
- ++ on the left of the number, then add the first since the operation, ++ on the right, the first increase since then calculates and can only be used for variables, constants does not act
- When the shift of type int integer operands> 32, 32 of the first remainder, then the shift operation >>; when the shift operand of type long integer of> 64, 32 of the first remainder, then the shift >> operation
- N-bit left shift is equivalent to multiplying the n-th power of 2, right by n bits, corresponding to the power of n divided by 2
- == equal, if the comparison operands are two types of values, even if they are not the same type of data as long as their values are equal, to return true; if both operands are reference types, only when the two reference when the type of the variable relationship with a parent can compare and must return true reference point to the same object will
- And the difference || |: when | the left is true, | the right to continue to operate; when || really is time left, not the right || operate. && similar ||