Definition
To create an object from a class.
Characteristics
- Used in object-oriented programming
- Creates a new object in memory using a class as a template
- Calls the class constructor to set the object’s initial state
Examples
- Instantiating a
Personobject (Python):q = Person("Quintin")
Non-examples
- Initialising a variable (Python):
x = 5 - Declaring a variable (C):
int x;