levo

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.

Your recallNot started
Key term

State the relationship between an object, its class and its methods.

Key term

What is a constructor?

Key term

What is meant by sending a message to an object?

Questions from this subtopic

Each one with the model answer underneath.

  1. 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. 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. 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. 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. 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. 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.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Hardware: Architecture, Memory and Storage
Networks and Data Transmission
Logic Gates and Boolean Algebra
Data Representation and Data Types

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

Fetch, , execute.
decodecompilestore

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AEncryption is reversible.
BThe stored form could be decrypted.
CA hash cannot be reversed.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A bit is a single binary digit.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

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.