Skip to content
Describe the elements of object-oriented system.
- Objects:
- Objects are like things in our problem world, whether real (like a student) or conceptual (like a bank account).
- They have information (attributes) and can do things (behavior).
- Attributes:
- Think of attributes as characteristics or details about an object.
- For a student, attributes could be their name, age, and grade.
- Behavior:
- This is what an object can do. For example, a student can study, a car can drive.
- It’s the actions or operations an object can perform.
- Class:
- A class is like a blueprint that defines what attributes and behaviors objects belonging to it will have.
- If “student” is a class, then individual students are objects.
- Methods:
- Methods are actions or functions that a class (or object) can perform.
- For a student class, a method could be “study” or “attend class”.
- Message:
- Messages are like requests or commands that objects send to each other.
- It’s how objects communicate. If a student wants to “study,” it sends a message to itself to perform the “study” method.