 Hey everybody this is Brian and we're going to be covering ternary operations today and what is this weird word? It's a very modified if then statement. We will start with some integers here. We'll say integer x and we're just going to assign zero just for the time being. We're going to do integer a. We'll say a is 100 and we'll make another one integer b. We'll say this is 200. Now here's where the real magic comes in. Let's say you want to make a decision based on the value of a. So we will say x equals and let's say if a is greater than 50 then notice it's a question mark a else b. Now what are we doing here? What we're saying is we're going to take a code block here or a statement and we're going to get a boolean value. Is a greater than 50? Well as you can see a is 100 so yes a is greater than 50 and this is our if statement question mark. So if it's true we're going to return a into the value of x. If it's false we're going to return b into the value of x. We'll just do a simple system out print line. We're just going to print the value of x just so we can see what's going on inside. Run this and you see we're printing the value of a which is 100. Now let's modify this slightly and say if a is greater than 101. Now what's it going to return? Is it going to return a or b? Well it's going to return b because a is not greater than 101 so it's going to return a false. The first position after the question mark is if the condition is true the second is if it is false. To prove that let's just run it, say our work and it returns 200 which is the value of b. So that's a ternary operation. I thank you for watching. I hope you found this educational and entertaining.