In Java, every variable, constant is a type.
variables :
Example: int i;
Double A;
1 The variable name must be a sequence of alphanumeric characters beginning with a letter. But unlike most programming languages, the range of letters and numbers in Java is larger, and the letters include ' a ' ~ ' Z ', ' a ' ~ ' Z ', ' _ ' or any Unicode character that represents a letter in any language, such as Chinese: declaring String \u4f55\u660a\u9633 ; Initialize \u4f55\u660a\u9633= "He Haoyuan Yang", or string he Haoyuan Yang; he haoyuan Yang = "he Haoyuan Yang";
2 initialization is a good practice when declaring, never use uninitialized variables.
3 variables are divided into local variables and global variables
Constants : Example: Final double nasna=2.12212;
A 1 final modified variable is called a constant, which can only be assigned once, once the assignment cannot be changed.
2 customary constant names to capitalize
The constants of 3 static modifiers are called Class constants and can be common in a class. If declared as public can be used by other classes such as: Static final String sdnaksnd= "class constant";
Note: Class constants are declared outside the method, and only local constants can be declared within a method.
operator :
Category: 1 arithmetic operators +-*/%
2 self-increment self-decrement operator + +--
3 Relational operators > < >= <= = =! = Three mesh operator:? :
4 logical Operators && | | !
5-bit Operators & | ^ ~ >> << >>>
Java core technology variables, constants, operators