How did you do? Let's break it down....
int cotton = 3;
int candy = 4;
System.out.println ( cotton + candy );
The computer creates a variable of type integer named cotton and assigns it the value 3.
Next, the computer creates another variable of type integer named candy and assigns it the value 4.
The next line of code instructs the computer to display on the console the value of cotton + candy.
The computer will go find the value stored in cotton 3, and the value stored in candy 4. Both values stored are integers, so the computer calculates the sum and displays the result of 7 on the console.
This procedure is used whenever the computer runs calculations using variables. To see this in action, you can run the program below.
For further exploration, change the operation to subtraction, multiplication, division and modulus. You can even add additional variables.
The concepts covered in these last two modules are some of the most foundational concepts in computer science. It is imperative that you understand them because you will use almost constantly from this point on.