Now that you have learned to create a variable in java we will create our first math equation. To start we need the following code:
int MyVar = 10; Now we will use this to make a math equation. if (MyVar == 10) { System.out.println("This is working"); } which means if the variable is = to 10 then we will run System.out.println to say that it works! There is many different types of math so here are the following symbols used for math equations. Remember you can always do something like int NewINT = MyVar + 10; to get 20.
These are all of the math equations you can do. Now it's your turn to go into Eclipse and try it out for yourself.
Thank you for reading my tutorials and I will make new ones soon. If you would like to go back and keep up with other tutorials click below. -Hero