Discriminating between objects
Using my previous Vehicle class.
Vehicle car1 = new Vehicle();
car1.sManufacturer = "BMW";
car1.sModel = "Five Series";
Vehicle car2 = new Vehicle();
car2.sManufacturer = "Ford";
car2.sModel = "Fiesta";
Creating an object car2 and assigning it the manufacturer “Ford” has no effect on the car1 object. The ability to discriminate between objects is the real power of the class construct. Objects can be created, manipulated and dispensed with in isolation from other objects of the same class.
Read more: rwilliamson.net