Putting data into a variable is called assignment. It uses the assignment operator = . Use the assignment operator with a variable name on the left and the data on the right. You can assign data anytime after a variable has been declared.
The following example declares a variable named userAge to hold an integer and then assigns it the value of 21.