We can combine these two steps into one statement: Rectangle rect = new Rectangle();. This creates the object and assigns the memory address to the object variable. The object reference does not store the rectangle object itself but only the memory address of the rectangle object. This can be illustrated as Rectangle rect1 = new Rectangle();, which stores the memory address of the created rectangle object in the object reference rect1.
We can combine these two steps into one statement: Rectangle rect = new Rectangle();. This creates the object and assigns the memory address to the object variable. The object reference does not store the rectangle object itself but only the memory address of the rectangle object. This can be illustrated as Rectangle rect1 = new Rectangle();, which stores the memory address of the created rectangle object in the object reference rect1.