← Object-Oriented Programming learning pathObject-Oriented Programming · Module 2 of 10
Classes and objects
Define classes and create objects from them.
📖 Key ideas
- A class is a blueprint; an object is an instance.
- Constructors initialise new objects.
- Java: new Student("Asha"); Python: Student("Asha").
- this (Java) / self (Python) refers to the current object.
- Many objects can be created from one class.
💡 Real-life example: A class is a cookie cutter; objects are the cookies.
ClassBlueprint for objects
InstanceObject created from a class
ConstructorMethod that initialises objects
this/selfReference to the current object