if(a=b){} //assigns to "a" the value of "b". Then, if "a" is nonzero, the code in the curly braces is run. if(a==b){} //runs the code in the curly braces if and only if the value of "a" equals the value of "b".