-------<a href= "http://www.itheima.com" target= "blank" >android training </a> <a href= "/http/ Www.itheima.com "target=" blank ">java training </a>, look forward to communicating with you! ----------
First, identifiers
1, consisting of letters, numbers, underscores, and the first must be a letter or underline
2. Case-sensitive in C, keyword cannot be used as identifier
Second, the key word
Definition: A word that is given special meaning by Java.
Features: The expression is English lowercase.
Three, constant
Definition: A fixed value in Java that represents an immutable number.
Categories of Constants in Java:
1, integer constant. All integers.
2, decimal constant. All decimals.
3, Boolean constant. More unique, only two values. True false.
4, character constant. A numeric letter or symbol is identified by a single quotation mark (' ').
5, string constant. Identifies one or more characters in double quotation marks ("").
The 6,null constant. There is only one value: null.
Iv. variables
Concept: A storage space in memory. Has its own name (variable name) and type (data type).
Function: It is used to keep the same type of data, and can be reused.
Define the format of the variable: data type variable name = initialization value;
automatic promotion of type:
In operations, when low-type data is computed with high-type data, the system automatically promotes the low-type data in the expression to a high type. Such as:
byte B = 3; int C;
C= B + 2; b automatically promotes the operation of the int type.
Five or three-tuple operator
Ternary operators
Format:
(conditional expression)? Expression 1: Expression 2;
A) If the condition is true, the result of the operation is an expression of 1;
b) If the condition is false, the result of the operation is an expression of 2;
Example:
Gets the large number of two numbers.
int x=3,y=4,z;
z = (x>y)? The x:y;//z variable stores a large number of two numbers.
Dark Horse Programmer--identifiers, keywords, constants, variables, ternary operators