Home > Java > javaTutorial > body text

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

little bottle
Release: 2019-05-29 11:28:23
Original
7783 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template