levo

Defining Data: Types, Variables and Classes

Objects as occurrences of a class

  • 3 things to know
  • AS Unit 1

Overview

Saying that an object is an occurrence of a class, term for creating an object from a class and state of an object.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is meant by saying that an object is an occurrence of a class?

Key term

Two objects of the same class hold entirely different data. Explain how one class definition supports that.

Key term

What is a class?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a class?

    Model answer

    A class is a template that defines the attributes and methods shared by a whole category of things, without holding any data of its own for a particular member of that category.

  2. 2

    What is an object?

    Model answer

    An object is a single occurrence of a class, created at run time, holding its own values for the attributes the class defines.

  3. 3

    What is meant by saying that an object is an occurrence of a class?

    Model answer

    The class states what every member of the category has and can do, and each object is one actual member built to that pattern, so the class is written once and the objects created from it may be many.

  4. 4

    What is the term for creating an object from a class?

    Model answer

    Creating an object from a class is called instantiation, and the object produced is an instance of that class.

  5. 5

    In the Java statement Account a = new Account("Ali", 250); name the class, name the reference variable and state what the keyword new does.

    Model answer

    The class is Account, the reference variable is a, and the keyword new allocates memory for a fresh Account object and runs the constructor to set it up.

  6. 6

    Why can one class have many objects while one object belongs to only one class?

    Model answer

    A class is a definition and can be used as the pattern for any number of instances, whereas each object is built from exactly one definition and takes its structure from it.

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.

Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures

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.

A null is the of one.
absencepresencetype

Blank Blitz makes facts automatic

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

AA null means no value has been recorded.
BZero and an empty string are values.
CA null is the absence of a value.

Build It gets the exam shape right

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

An error is the mistake a person made.
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 Defining Data: Types, Variables and Classes, 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.