Objects (OOP) (OCR A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What is a class in OOP?
What is a class in OOP?
Blueprint defining structure & behaviour of objects
What is an object in OOP?
What is an object in OOP?
Instance of a class with attributes & methods
What are attributes in OOP?
What are attributes in OOP?
Data that represents the state of an object
What are methods in OOP?
What are methods in OOP?
Functions defined within a class describing behaviours
How to create an object
How to create an object
Call the class like a function with initialisation data
Relationship between object and class
Relationship between object and class
Object is a specific instance of a class
Do objects share attribute values?
Do objects share attribute values?
No - each object has its own set of attribute values
What can methods do with attributes?
What can methods do with attributes?
Use and modify the object's attributes
How can you modify object attributes?
How can you modify object attributes?
Directly or by using methods
How do multiple objects operate?
How do multiple objects operate?
Each object operates independently
What do objects bundle together?
What do objects bundle together?
Both data (attributes) and actions (methods)
How do objects hold their state?
How do objects hold their state?
Through attributes
