 Hi guys, so in this video, we're going to be playing with what we've already learned about creating arrays and copying arrays in Java. And we're just going to be looking at a few different examples here to help us build our understanding of how array referencing works. So you can see here I have integer array a which contains four values. So drawn in our notation we just have a which refers to an instance containing four values like sir. And then here I have b which is a reference copy of a which means it's just going to look like this with b referring to the same instance as a. Alright, so now let's go back to Eclipse and start stepping through this with the debugger. Alright, so we've got our array a you can see here it's got an ID of 22 and contains four values. And then b has the same ID because it is a reference copy. It points to the same instance with the same four values. Now next what we're going to do is we're going to say b3 equals a1. So just have a think about what you expect to happen before I step through. Alright, and then I'll go ahead and step through here. Okay, so what's happened here so we've said b3 equals a1. So if we look over here at our instance here we have obviously index 0123. So this is b3 and this is a1. So when we say b3 equals a1 we change this 90 here to a 70 and because a and b refer to the same instance they both get changed. So b3 and therefore also a3 becomes 70. Alright, and next we have here a1 equals negative 50. So this is a1 so let's step through and see what happens. And I imagine that this is probably what you expected to happen since a and b refer to the same instance when we change a1, b1 also changes and they both become negative 50. Now that might seem obvious but nerd however what didn't happen when we changed a1 just now it had no effect on b3. So even though up here we've done b3 equals a1 after that fact we can change a1 and it will have no effect on b3 or a3. And if you look at this you can kind of see why. When we changed b3 all we did was change the value to 70 but b3 is not linked to a1 in any way. So we can change a1 after the fact and it has no effect on b3. So I hope that's clear from that explanation. Alright so moving on so we're just going to print out a3 and then moving on so we're going to create an array c. And you can see c equals b2, b1, b3. So probably you can imagine what c is going to look like when we step through. So c has just taken the value b2, b1 and b3 and now refers to a new array. So this is what c is going to look like in our notation. And what you should be able to notice here as I'm drawing this is that c is in no way a reference copy of b. While we have copied elements from b in order to create c, c now refers to a completely new instance that is no longer after the initial creation tied in any way to b. Alright so now when we go ahead and say b3 equals 100, let's see what happens. b3 changes as you would expect, a3 changes, but hopefully also as you would expect. Even though we created c2 out of b3, c2 does not change because c now refers to a completely separate instance from the instance that a and b refers to. So then obviously you can see the 7t here changes to a100, both a3 and b3 now equal 100, but c remains the same. And we'll just go ahead and finish that by stepping through and printing out c2. Alright so that was just a quick play around with array references and hopefully that helped solidify your understanding of how they work. So thank you for watching and have a great day. Bye.