Home  >  Article  >  Java  >  What is the difference between = and == in java?

What is the difference between = and == in java?

little bottle
little bottleOriginal
2019-05-29 11:28:237761browse

Some friends don’t know much about some of the operators when programming in java. This is the basis of java. It must be understood and mastered in order to use it skillfully in daily operations. Let’s talk to you about the difference between = and == in Java.

What is the difference between = and == in java?

In the java programming process,

"=" is the assignment operator

means to let the left The value becomes the one on the right, for example, x=3, which means that the value of x is 3.

"==" is the equal operator

It means to judge whether the left and right sides are equal, for example if(x==3)x=4; means if the value of x equals 3, then let x equal 4.

The above is the detailed content of What is the difference between = and == 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
Previous article:What is 500 error in jspNext article:What is 500 error in jsp

Related articles

See more