
#3 Known is a drop ! Introduction to Class & Objects
23/Feb/2026 What is a Class? A class is defined as a template or blueprint from which objects are created . It is a logical entity , not a physical one, meaning no memory allocation occurs for a class itself during program execution. Memory is allocated only when an object is instantiated from the class. A class does not occupy memory on its own. Memory is allocated when an object is created. From one class, you can create multiple objects. A class Can contain: variables → store object data Methods → define behavior Constructors → initialize objects Static members → shared across all objects Inner/nested classes → classes inside a class Class -Nomenclature Must start with: A letter (A–Z or a–z)Or $ or _ Cannot start with a number Cannot use Java keywords (class, public, static, etc.) Case-sensitive → Student and student are different No spaces or special characters allowed Use PascalCase / UpperCamelCase eg: BankAccount Syntax: [access_modifier] class ClassName { // Fields (variables)
Continue reading on Dev.to
Opens in a new tab



