A class is a blueprint used to create objects.
It defines the structure of data (fields) and behavior (methods) that objects will have.
An object is an instance of a class. It is created using the new keyword.
Each object has its own copy of the class's data.
Fields are variables inside a class that store data for each object.
Each object gets its own version of these fields.
Methods define behavior for objects.
They allow objects to perform actions using their data.
A constructor is a special method used to initialize objects when they are created.
It has the same name as the class and runs automatically when using new.
The this keyword refers to the current object.
It is commonly used to distinguish between class fields and constructor parameters.
You can create multiple objects from the same class. Each object stores its own data.
Classes help organize code and model real-world concepts.
Create a Car class with brand and year. Then create two objects and print their details.