Home > Java > JavaBase > body text

What does == symbol mean in java

Release: 2019-12-11 17:23:55
Original
17027 people have browsed it

What does == symbol mean in java

"==" in Java is a relational operator, which checks whether the values ​​of the two operands are equal. If they are equal, the condition is true. (Recommended: java video tutorial)

1. For basic data types, == indicates whether the values ​​are equal,

For example:

int x = 3;
if(x==3){//true
//do something  
}
Copy after login

2. For object data types, == indicates whether the address values ​​​​are equal.

For example:

String str1 = new String("str1");
String str2 = new String("str2");
if(str1 ==str2){//false
//do something
}
Copy after login

For more java knowledge, please pay attention to the java basic tutorial column.

The above is the detailed content of What does == symbol mean 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!