ICSE Class 10 Computer Applications Question 8 of 26

Operators in Java — Question 8

Back to all questions
8
Question

Question 8

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.