First, we will look at incrementing variables. ++ increments a variable by 1 and — decrements a variable by one. There are many other expressions that can be used to do math on variables so be sure to check them out in the Java API’s.
Java arithmetic operators work just like math operators. You can use + for addition, – for subtraction, * for multiplication, / for division and % for modulus (division that gives you the remainder). There are also other operators that can be used to compare numbers or other expressions. The following will show you the precedence of operators.
First, let’s learn about print statements. In java there are two types of print statements print and println and they are referenced this way: System.out.print(“Hello World”); or System.out.println(“Hello World”);. The difference between print and println is that println will have a character return after the line is printed and print will not. Remember, java is case sensitive so be sure to capitalize those S’s.
For the next few weeks I will be using labs from my Java programming class to give some tutorials on java (Thanks to my awesome Java teacher). Java is one of my favorite languages and I will soon be undertaking an advanced Java class. Because of that, I thought this would give me a good refresher and help out everyone else who’s looking to learn some Java. This series of tutorials will include some basic programs, nothing too advanced.

