0
Do you mean referencing an object? Accessing an object's methods and variables without instantiating the object? You don't always need/want the entire object in order to perform a function. For example, let's say you have a program that calculates whether or not a person is old enough for something. You have a person class with name, age, sex, all the good stuff. In the method that checks for age you only need the age variable. You could create an object and have all its information, but most of it will be useless. You just need age, so you reference that objects variable to save you from having a full object you don't need.
27th Jul 2016, 4:24 AM
James
James - avatar