Used to provide specific values to object fields at the time of creation.

Methods are called on objects using the dot ( . ) operator.

are blocks of code that perform specific tasks. They represent the behavior of an object. Methods help in code reusability and keeping the logic organized.

Classes and objects form the heart of Java. Classes provide the structure, while objects provide the realization of that structure. Methods define how these objects interact, and constructors ensure they start their lifecycle in a valid state. Master these four pillars, and you have the foundation to explore more complex topics like inheritance and polymorphism.

An is a basic unit of Object-Oriented Programming and represents a real-life entity. When a class is defined, no memory is allocated until an object of that class is created. Instantiation: Objects are created using the new keyword.

Each object has its own copy of the fields defined in the class.

A is a special type of method used to initialize objects. It is called automatically when an object is created. Rules: It must have the same name as the class. It does not have an explicit return type (not even void ). Types: Default Constructor: Provided by Java if none is defined.