The Object as the Primary Computational Unit:
In Java, computation revolves entirely around objects. An object is a real-world entity or abstract concept that possesses three quintessential characteristics:
- State (Attributes / Data Members): The intrinsic properties, characteristics, or values held by the object at any given time. For an
Accountobject, state includesaccountNumber,holderName, andbalance. - Behaviour (Functions / Member Methods): The operations, transformations, or actions that an object can perform or have performed upon it. For
Account, behaviour includesdeposit(),withdraw(), andcheckBalance(). - Identity (Memory Address): A unique, system-level identification distinguishing the object from all other objects in memory, even if two objects possess identical state values.
The Class as an Object Factory (Blueprint):
A class is an abstract template, blueprint, or specification from which individual objects are fabricated. Just as an architectural blueprint defines the dimensions and structure of a house without itself being a physical shelter, a class defines the fields and methods without allocating memory for actual data until an object is instantiated. Hence, a class is famously known as an "Object Factory".