A variable usually stores a value directly, but an object variable can refer to an object. You assign an object to a variable for the same reasons that you assign a value to a variable:
- A variable is usually shorter and easier to remember than a long chain of properties and methods.
- A variable that refers to an object gives better performance than access to the same object through property or method calls.
- You can change a variable to refer to other objects while your code executes.