Term | What it is | Relation to others | Common Examples |
---|
Class | A blueprint/template that defines fields (data) and methods (behavior). | You create instances/objects from a class. | class Dog {} in Java/Python; Account object in Salesforce. |
Object | A runtime entity created from a class, containing both data (state) and methods (behavior). | Every object is an instance of some class. | Dog d = new Dog(); → d is an object. |
Instance | An object tied to its class — emphasizes of what type the object is. | “Object” describes what exists; “instance” describes its relationship to a class. | d is an instance of Dog . |
Record | A data container/row (fields only, little or no behavior). In some languages (e.g., Java), it’s a special class type for simple immutable data. | In databases/Salesforce: a record = one row of data. In OOP: a record = a lightweight object. | SQL row: (id=1, name='Alice') ; Java record: record Point(int x, int y) ; Salesforce Account record. |
Quick way to remember
- Class → the recipe.
- Object → the cake baked from the recipe.
- Instance → saying “this cake is an instance of ChocolateCake recipe.”
- Record → a simple cake box with just the label (no frosting/behavior).