 Hi guys. So today we're going to be exploring reference representation by taking a look at how we can create memory diagrams involving primitive data types, arrays, objects, and combinations of the three. So you can see here we have five examples and we're going to be taking a look at each of these examples and how they can be represented in memory diagram form. So for our first example we have int n items equals 40. So we have the value 40 held by the variable n items which is of primitive data type int. Now if we take a look over here at our first memory diagram you can see it's very simple. We simply have n items equals 40 contained inside a single box. So this is how you can represent values held by primitive data types. You can just say variable equals value. So moving on to our second example here we have integer array data equals 10, 70, 20, 90. So in this example data is a reference to four different instances of integer values and this is represented in this memory diagram like sir. So we have data and it points to the four different instances 10, 70, 20, and 90. So this is how we can represent one dimensional arrays of primitive data types using memory diagrams. So moving on to our third example here we have rectangle rect equals new rectangle 2050. So here rect is an object which is an instance of the class rectangle and you can see here that rectangle just has two variables width and height. So here we've created a new rectangle called rect with a width of 20 and a height of 50. And this can be represented as a memory diagram like sir. So here we have rect which is a reference and must be drawn inside its own box and it points to two instance variables width and height. So this is how we can represent an object in memory diagram form. All right, so moving on now to our fourth example which involves a multi dimensional array. So you can see here we have int multi equals data, data, data, multi one equals null and multi two equals new int zero. So in other words multi two points to an empty array. Now if we take a look at the memory diagram for this example you can see we have multi which is a reference and which points to three other references. Zero then points to the array data which contains four different instances of integer values. We then have one equals null which is just represented like sir. And then we have two which points to an instance of an empty array. So you can see here this is how you would represent a multi dimensional array of the memory diagram and note here the difference between representing a null array and an empty array. So moving on now to our final example which involves an array of objects. So you can see here we have an array of rectangles. The array is called boxes and it contains three rectangle objects. We then just have this loop which assigns values to the width and height of each rectangle inside the array. So if we take a look here at our memory diagram you can see we have the array boxes which points to three different references which each point to an instance of a rectangle object which contains two instance variables width and height. And so that's how we can represent an array of objects using a memory diagram. So I hope you found this video helpful and thank you for watching.