WJEC A-Level Computer Science 601-5345-3
Hardware: Architecture, Memory and Storage
Networks and Data Transmission
Logic Gates and Boolean Algebra
Data Representation and Data Types
Data Structures
Organisation of Data: Files and Records
Database Systems
The Operating System
Algorithms and Programs
Principles of Programming
Systems Analysis
Software Engineering and Program Construction
Types of Software System
Practical Programming
Data Security and Integrity
Computing, Society and the Law
Advanced Data Structures and Logic
Recursion, Sorting and Searching
Programming Paradigms and Translators
System Design and Human-Computer Interaction
Software Engineering Tools and Professional Practice
Advanced Architecture and Assembly Language
Communication Networks and File Organisation
Number Representation and Floating Point
Databases and Distributed Systems
Operating System Management
Software Systems and Applications
Data Security, Cryptography and Attack
Programming Paradigms and Translators
Classes, methods and object-oriented design
- 3 things to know
- A2 Unit 3
Overview
Relationship between an object, its class and its methods, sending a message to an object and accessor method.
What you need to know
Answer each one before you reveal it.
What is a constructor?
What is meant by sending a message to an object?
Questions from this subtopic
Each one with the model answer underneath.
- 1
State the relationship between an object, its class and its methods.
Model answer
A class is the template that defines the attributes and methods, an object is one instance created from that template with its own data, and a method is an operation the object carries out on that data.
- 2
What is a constructor?
Model answer
A constructor is a method that runs automatically when an object is created and sets the object's attributes to their initial values.
- 3
What is meant by sending a message to an object?
Model answer
Sending a message means calling one of the object's methods so that the object itself acts on the data it holds.
- 4
What is an accessor method?
Model answer
An accessor method returns the value of a private attribute to the caller without allowing the caller to alter it.
- 5
What is a mutator method?
Model answer
A mutator method changes the value of a private attribute, normally after checking that the new value is acceptable.
- 6
How do private attributes reached only through public methods enforce information hiding?
Model answer
Nothing outside the object can touch the attributes directly, so every change passes through a method that can validate it and the way the data is stored can be altered without disturbing any other code.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Programming Paradigms and Translators, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.