Assignment Operator

Assignment operators are used in Java to assign values to variables. For example,


\begin{lstlisting}
int age;
age = 5;
\end{lstlisting}

The assignment operator assigns the value on its right to the variable on its left. Here, 5 is assigned to the variable age using = operator. There are other assignment operators too.



Subsections