An assignment operator is used to assign a value to a variable, for example, int a = 40. The “=” is the assignment operator; in this case, it was used to assign a value to variable “a” which has an int datatype. The assignment operator is not the same as the mathematical “=” (equal to) the symbol for equal to in Java programming language is “==”.