+ 3
What is == means?
== sign
11 Answers
+ 5
== is a comparison operator used for primitive datatypes.
It checks whether 2 values are equal.
a == b means in words that "a is equal to b".
As == is a comparison operator, it returns a boolean, which can have 2 different values: true and false.
if a and b are equal, a == b evaluates to True,
but if a and b are not equal, a == b evaluates to False.
Examples:
4 == 5: false
2 == 2: true
9 == 7: false
0 == 0: true
1.5 == 1.0: false
6.0 == 6: true
8.8 == 8.8: true
4 == 1.0: false
false == true: false
true == true: true
"Abc" == "Abc": error
+ 4
(==) comparison operator is a binary operator that takes two operands whose values are being compared.
ex: a= 5
b=6
a == b --> returns false
+ 4
Check for equality as opposed to = which is used for assignment.
+ 1
You can also use == to compare refrenece variables to see of there equal or not, just dont use it to compare string values.
+ 1
It's comparison operator
If both variables are true further step is excutes other wise terminates.
+ 1
It compares the two variables whether they are equal in value đ
0
It is a comparison operator
0
== just checks equality, it does not say whether 2 values are necessarily same value.
You could agree that 4 bananas equal to 1 pineapple or 3 cars equal to 15 laptops, even though they are not the same things.
0
Many thanks!
0
It is used to check equality of two Expression
0
Made it simple:
== is used in if statements, loop etc...
It checks if a value is equal to something.
E.G.
if(a == 10){
// code here
}
Where as "=" sets the value to something else:
int a = 0;
a = 7; //here I changed the value of a with 1 "="