1. Key words
Concept: Words that are given special meaning by Java.
Example: Declaring a class keyword: class
Access Rights keyword: public
static modifier keyword: static
No return value type keyword: void
2. Identifiers
Concept: A name used to standardize a custom in a program
Composition: Alphanumeric underscore $
Spec: Cannot start with a number
Cannot contain spaces
Characters other than $ cannot appear
Cannot use keywords
Note: Identifiers in Java are strictly case-sensitive
Recommendation: Custom name best to be known
3. Data storage format
The data is stored in the computer in the form of a binary complement.
Positive numbers: The original code, the inverse code and the complement are consistent.
Negative Number: The original code: positive source code based on the highest position is 1.
Anti-code: negative source of the highest bit remains unchanged, the number of the remaining bits is reversed.
Complement: Negative inverse code +1.
Extension: Octal starts with 0
Hex 0x Start
Conversion between the binary:
Decimal to N binary: integer part: Divide by N, remainder inverse
Fractional part: Times n Rounding, Integer rounding
N-Decimal: Weighted Expansion summation method
4. Data operation
The highest level in binary is the sign bit
Smallest unit in computer: bit shorthand b
Minimum unit of processing data in a computer: shorthand byte b
5. Data type (Java is a strongly typed programming language)
Basic data types
Integer type
byte short int Long is the number of bytes: 1 2 4 8
Floating point Type
The number of bytes for a float double is: 4 8
Character type
The number of bytes that char occupies is: 2
Boolean type
The number of bytes in a Boolean is: 1
Reference data type
Interface type
Array type
Class type
6. Variables
Concept: A container for data that can change
Declaration format: Variable type variable name = data;
Suggested naming method: Small Hump name method: MaxValue
7. Data type Conversion
Small type turn large type: automatic type conversion
Large type turn small type: forced type conversion
8. Operators
Arithmetic operators
+ - * / % ++ --
Assignment operators
= += -= *= /= %=
logical operators
Logic and (&& or &)
Logic or (| | or |)
Logical XOR (^)
Logical NON (!)
Comparison operators
> < >= <=! = = = = = = =
Bitwise operators
Ternary operators
Escape character
9. How to compare the equality of string sequences: A.equals (b);
Compare the size of the string: A.compareto (b);
10, instanceof is a keyword and not a method, similar to the > number and the like.
Java Basic Syntax--(for future review)