Different between single (=) and double (==)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Different between single (=) and double (==)?

3rd Nov 2016, 6:05 AM
adil
5 Answers
+ 6
Example : x=8 means that you have assigned 8 to x,but x==8 means you are checking that x is equal to 8 or not
3rd Nov 2016, 6:36 AM
Muhammad Hamza
Muhammad Hamza - avatar
+ 2
(=) is an assignment operator which assigns the value of one variable to another...Like a=b here the value of b is assigned to a...And the (==) is an comparison operator which compares the value of 2 variables.... Like (a==b) here the value of a and b are compared...!!!
28th Nov 2016, 4:03 PM
rohit bisht
rohit bisht - avatar
0
= is an assignment operator and == is an equality operator
3rd Nov 2016, 6:08 AM
Brennan Thompson
Brennan Thompson - avatar
0
You use '=' when you are trying to specify a variable and you use '==' this when trying to initialize that this variable is equal to this variable. Int x = 5; if(x == 5){ //the code that would be compiled if the statements is true }
3rd Nov 2016, 7:00 AM
Abdelaziz Abubaker
Abdelaziz Abubaker - avatar
0
= is assignment operator , where u use it for assign any value through any type of data type and another == is equal operator , used for check any two values equal or not.
17th Nov 2016, 4:45 PM
bikash panda
bikash panda - avatar