Java Programming – Arithmetic Operators and Operator Precedence

I am continuing on with my video series on Java programming for beginners. In this video, I introduce the arithmetic operators and explain in detail how to use them, with many examples. I also discuss and illustrate the importance of operator precedence and provide a detailed example of a common error trap that beginner programmers tend to make.

The arithmetic operators are provided by the Java programming language to facilitate the familiar mathematical operations of addition, subtraction, multiplication and division.  There is also another operator called the modulus operator (represented using the percent symbol %).  The modulus operator is used to obtain the remainder when two integers are divided by each other.  For example, when 3 is divide by 2 i.e.: (3 / 2), then the reminder is 1.  That is too say, 2 divides into 3 one time with 1 over.