Welcome back everybody. This is Java as a second language course, a module number 2; Java controlled structures. Java supports arrays, arrays are data structures where variables contain multiple values, so we can have a data type that has multiple values. Arrays are a fixed size in Java. However, there are ArrayLists which are dynamic in size, meaning you can add values to them or add members to them or remove members. Values can be added or removed from ArrayLists using the methods add and get. These are slightly different from our C and C++. Java also has control structures such as if, if-else, while, do, for, continue, return statements, break, continue. These control structures are exactly identical to C and C++. Where with these control structures, a statement is evaluated for true or false, and then with these different control structures; different code, different functionality, it then takes place after the evaluation. Take a look here, in this case it's an integer array. With this integer array, we have in this case four integers. What's really going on here is in memory, the compiler's making space for not one with myNum, but four integers. We can see here a string array and a string array called pizza. In this case we see three strings, and we can see miniPizza which is an ArrayList, a string ArrayList, where we can maybe start off with three members and then add or remove members. Then there's the if structure. An if is a way of testing a condition. If the condition, just like in C and C++, if the condition evaluates to true, the code block is executed. Another control structure is the else. We can see else down here. We can see our if, we can see our statement, and if this statement is true, we see that this code block will be executed. In the case, if this evaluates to false, in this case since we have an else and the else is optional, the else block then will execute. There was no else block, we would just simply after this is evaluated the program will just move on to the next line of code. In the case where the if evaluates to false again, the else block will be there and this else block will then execute. Then there's also the else if structure, where we have the initial if statement with its own expression and its own code block, but we also have another expression, another code block after that. We can have as many else if's as we need in this single block. They all can have their own expression and their own code block. That is exactly similar to C and C++. Then finally at the end of the if, we can have a single else, not else if but else. Then that code block can execute based on the evaluation of all of these statements here. There are for loops. Just like in C and C++, with a for loop there is the header indicated by the for. Then we have the three parts here, the three parameters, the initialization of the iterator, the length of the iterator and then the counter has provided with this code block for the length of the counter here. With the for, code block will execute until the count is complete. In this case, the length here and when this length is no longer true, the code block will then stop and move on. The while loop, indicated by the while, has an expression and the code block in the while loop will execute until the expression is false. In this case we see here, this is actually an iterator and we're counting up and then we're testing. In this case, an iterator usually means some kind of data has come back. Provided the iterator can move to the next record and the next record after that, so some data comes back in a data set, say there are four records. As long as there's a record after the current record, this block will continue. However, once it gets to the fourth record or the last record, there's obviously not a fifth, then this expression hasNext will become false, and then the program will move on. For loops, while loops, their structure and their behavior are exactly identical to C and C++.