OOP · Building Blocks of OOP
Class vs Object
A class and an object are closely related, but they are not the same.
Introduction
A class and an object are closely related, but they are not the same. A class defines the structure, while an object is the actual entity created from that structure. Definition: A class is a blueprint, whereas an object is a real instance of that blueprint.
Visual Comparison

One class, many objects — the class is the mold, each object is a distinct casting.
class Dog {
String name;
Dog(String name) { this.name = name; }
}
public class Kennel {
public static void main(String[] args) {
// Dog is the CLASS (a single blueprint)
Dog a = new Dog("Rex"); // object 1 — its own state
Dog b = new Dog("Bella"); // object 2 — independent state
System.out.println(a.name); // Rex
System.out.println(b.name); // Bella
System.out.println(a == b); // false — different objects
}
}