← Object-Oriented Programming learning path
Object-Oriented Programming · Module 2 of 10

Classes and objects

Define classes and create objects from them.

📖 Key ideas

  1. A class is a blueprint; an object is an instance.
  2. Constructors initialise new objects.
  3. Java: new Student("Asha"); Python: Student("Asha").
  4. this (Java) / self (Python) refers to the current object.
  5. 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