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