hi in this video we're going to introduce general for Loops in Java so the format of a general for Loop is like this we say for some initialization semicolon some test semicolon and then some increment and then whatever code we want to execute so we were just dealing with the most simple version of a for Loop before and now there's a lot more General stuff we can do so let's look back at that loop with this General structure so when we say in I equals 0 that's the initialization step that happens once at the start and then there's the test step that's the question we ask every time to figure out if we should execute this round of the loop and then there's the increment step after we've executed one round of the loop we make this change so usually we're changing that variable so here we're saying I ++ add one to I so let's write a couple programs and look at a couple programs using a more General version of the for Loop so this is a program that writes a countdown from 10 all the way down to zero so we say for n i equal 0 I is greater than or equal to Z iusus and then here's a program that lets us count by two so we're saying from I is equal to 0 I is less than or equal to 100 i+ = 2 two so notice that we're saying less than or equal to it's a different test and then plus equals 2 we're adding by two not just by one let's go into our code editor and look at these problems okay so first let's write the countdown program so we're going to say for into I equal 10 I is greater than or equal to 0 iusus and then system.out.print Lin I so let's run this program great and so it does what we expect and what's really happening here is that we're starting I at 10 every time we're asking is I still greater than or equal to zero and then if it is we print out I and then the change of every round in the loop is we subtract one from I with I minus minus so if I change I starting from 10 to 100 what do you think it's going to do so let's find out we run the code and we'll see that instead it counts down from 100 all the way down to zero let's take a look at the other program so in this program we're going to count by twos from 0o to 100 so we'll say four into I equal 0 I is less than or equal to 100 I plus equal 2 remember plus equals is a shortcut for saying IAL I + 2 and then we'll say system. out print Lin I so let's run this and we'll see what happens we go 0 2 4 6 8 all the way up to 100 what do you think this is going to do if I change this plus equals from two to three what do you think that's going to do let's try it out what that does is has us end up Counting By Threes And so there you go we can see we're printing out I every time in the for Loop so that's the more general purpose version of for Loop