levo

Programming Paradigms and Translators

Classes, methods and object-oriented design

  • 3 things to know
  • A2 Unit 3
Start revising · £5/month

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.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

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

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

Fetch, , execute.
decodecompilestore

Blank Blitz consolidates the facts

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

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

A bit is a single binary digit.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

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.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.