ICSE Class 9 Computer Applications Question 5 of 21

Operators in Java — Question 5

Back to all questions
5
Question

Question 5

State the difference between = and ==.

Answer
===
It is the assignment operator used for assigning a value to a variable.It is the equality operator used to check if a variable is equal to another variable or literal.
E.g. int a = 10; assigns 10 to variable a.E.g. if (a == 10) checks if variable a is equal to 10 or not.