QuickDevGuide

Home › OOPs

Class — OOPs

A Class is a blueprint or template used to create objects. It defines the structure and behavior that objects of that type will have. A class defines variables (data members), methods (member functions), and importantly — memory is not allocated when a class is created, only when objects are instantiated from it. Think of a class like an architectural blueprint of a house. The blueprint is not a real house, but it defines exactly how the house will look — its rooms, dimensions, and layout. Similarly, a class defines properties (data) and methods (actions) but doesn't occupy memory for actual data until an object is created. Class Components Classes typically contain: a Constructor (initializes the object’s state when created), Properties/Fields (data the object holds), and Methods…

Key Takeaways