Home >Java >Javagetting Started >What does = mean in java?

What does = mean in java?

青灯夜游
青灯夜游Original
2019-12-27 13:54:244582browse

What does = mean in java?

"=" 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn