"=" means assignment, which is an assignment operator that can assign a value to a variable, such as int a = 10;
Assign the literal 10 Give the integer variable a.
Assignment operators include:
=, =, -=, *=, /=, %=, &=, ^=, |=, <<= ,>>=
Using "=", a = 10;
is equivalent to a = a 10;
. "-=" is the same thing.
Expansion:
"==", "!="
means when using "==" The judgment is like if (a==10). If a is equal to 10, it will be executed. If it is not equal, the statement in the if will be skipped and the subsequent statements will be executed. "!=" means to judge whether it is not equal, and execute if it is not equal.
Mention it more and you will definitely learn it in the future. "==" compares address values. The basic data type uses "==" to compare the address of the constant pool data, and the reference data type uses "==" to compare the address of the object.
Recommended learning: Java video tutorial
The above is the detailed content of What does = mean in java?. For more information, please follow other related articles on the PHP Chinese website!