Object Creation
OOP objects mimic (imitate) real world objects:
Like real world objects, OOP objects can be created by various means:
- CREATED from a blueprint (e.g., a house or a car)
NOTE: Although a blueprint itself is an object, it is NOT the actual object, it is a set of instructions on how to build an object. Blueprints in OOP are called Classes (with a capital C).
- BIRTH from a parent object (e.g., a baby or an animal). The key word to “birth” an instance of an object in an OOP language is the word “new.”
- COMPOSITE of other existing objects (e.g., a house, car, computer or TV)
© 2015. RMCS. All rights reserved.