In this module, we'll continue our look at Java Language Fundamentals, specifically in this case, flow control. Now, we'll look at additional aspects of the Java language syntax. In order to talk, for example, about flow control, we might need to talk about comparisons. We're going to look at the various built-in operators, not just the logical or comparing operators, we'll look at them all. Look at writing simple Java expressions, and so this lesson will focus on operators. The next lesson will focus on then branching if this condition or if this other condition. We will look in the third lesson of this module at looping. Relatively doing something based on how many items there might be to process or until a condition or while a condition. Operators perform in general and Java on primitives. We're talking about being able to add, subtract, multiply, divide. We're looking at comparisons less than, equal to, greater than, and notice I said primitives. When we're talking about comparing objects, we're going to learn that what we really need to do there or use methods, not the individual. Look things that look like functions, not the methods, the symbols for comparison. A syntax is going to be fairly straightforward and may already be familiar to you in terms of the use of operators from just your basic math or other languages, since this notation is fairly common across many different languages. One of the operators we're going to talk about, and I would say not probably, but certainly, the most common operator in Java is the doctor operator, which is the one that allows us to access the members, whether it's data or methods of an object. If I have an employee and I want to refer to the employee's department, that might be, my employee dot get department. So the dot was allowing me to access the get department member. Here are operators in Java. We have assignment, we have addition, subtraction, multiplication, division, and the percent is if we're dealing with integers, then when we divide, I'd say we divide 12 by 5. Well, the answers two, but the remainder is two, in integer terms, 12 divided by 5 is 2, which is only 10, but there's a remainder of two. We have increment and decrement. If I have a number, and if I have an integer and I want to increase it by one, I can say plus plus i. If only that is subtracted by one, I can say minus minus i. So plus plus and minus minus. Those can go in front of or behind the thing or to the left of or the right of the variable that we're trying to increase. If I put it to the left of the variable plus, plus i, first it will increment i, and then the resulting expression will be the increased value. On the other hand, if I were to say i plus plus, and sometimes we do that for example, in a loop with an array index. If I say i plus plus, first we use the current value of i, and then it gets incremented. It matters significantly whether it's plus plus i or i plus plus. Pre-increment or post-increment, depending on whether you have put it on the left hand or right-hand side. Relational operators. Less than the double-equals can notice a difference between assignment. The double equal is equals as a comparison. The greater than, less than or equal, greater than or equal, not equal. Again, these are going to be useful with primitives. If you try to use this with objects, what you'll find is, well it doesn't do objects. What it does is primitives, and so you'd literally be comparing the reference value, which is basically worthless. The only use for that if you literally wanted to know if two objects were the same or are not the same, then it would be comparing the two references for equal or the two references for not equal. But this is why you'll find that we have methods for comparing objects, not the operators. As in the last module when we talked about primitives, these operators compare primitives. Now we also have a logical operators ending, oaring and a not. Logical operators we're dealing with Boolean values or Boolean expressions. Is this less than that to and some other value greater than another one? That would be the double ampersand between the two comparisons. What about is the department of HR or is the department IT? Well now I be using the oars to compare. What if I wanted to say, ''Joe is not a Manager'' Not so I'd be using the negate so that Joe is Manager. Not it put not in front of it, not Joe dot is Manager. We also have the ability to do bit wise comparisons. So ending at the bit-level ordering, at the bit level, complementing at the bit level exclusive or at the bit level shift left, Shift right, and another Shift right, because we're dealing with when you Shift left, you're always bringing in from the right hand side a zero to replace the value that you just shifted into the next bit position. But what if I'm shifting to the right? The question is, am I shifting to the right without taking the sign into account or with taking the sign into account. That's why we have two different shift operators. The two symbol version is the signed right shift and since we are working with signed numbers exclusively in Java, it's the common one, but you may have some cases where you don't care about the sign bit and you want an unsigned shift. The left-most bit other than the sign will be a zero as you shift and so that's what this version does. Now the dot notation or the dot operator is for accessing members, whether there are attributes or method for the particular instance, the particular object.