levo

Defining Data: Types, Variables and Classes

  • 12 subtopics
  • 36 things to know
  • AS Unit 1

What Defining Data: Types, Variables and Classes covers

Defining Data: Types, Variables and Classes is examined in Unit AS 1, Introduction to Object Oriented Development — a written examination. It covers primitive types and their storage, reference types, objects and null, declaring variables, scope and lifetime, type casting and conversion, arithmetic operators and expressions, relational and logical operators, operator precedence and evaluation order, objects as occurrences of a class, abstract, base and inherited classes, attributes and the properties of a class, static variables in a class and interfaces and class reusability.

Where it is assessed

AS Unit 1

Introduction to Object Oriented Development.

Check the CCEA specification ↗

The 12 subtopics

Each one has its own page.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What range of values can a signed 8-bit integer hold, and how does that range follow from the number of bits?

Key term

Why is a sum of money badly represented by a float or a double?

Key term

What is a constant, and how is a constant declared in Java?

Key term

What is variable shadowing, and how is a shadowed attribute reached in Java?

Key term

Why does Java convert an int to a double automatically, but refuse to convert a double to an int without a cast?

Key term

What is the value of 9 / 2 * 2 in integer arithmetic, and why?

Key term

int i = 3; int r = i++ + ++i; — what values do r and i hold?

Key term

What is short-circuit evaluation?

Key term

Explain why if (count != 0 && total / count > 5) is safe but reversing the two conditions is not.

Key term

Explain the difference between the logical AND written with two ampersands and the version written with one.

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

State the is-a test, and apply the test to decide whether Car should inherit from Engine.

Key term

Why must every attribute be declared with a type?

Key term

What is the difference between the attributes of a class and the values held by one object?

Key term

How does a well-designed class library shorten development and reduce defects?

Key term

What is the essential difference between what a primitive variable holds and what a reference variable holds?

Key term

What is operator precedence?

Key term

What is a static variable?

Key term

In Java, after the statement String s = new String("Ali"); what does the variable s actually contain?

Key term

How does implicit widening conversion differ from explicit narrowing conversion?

Key term

What is associativity, and which way do the arithmetic operators associate in Java?

Key term

What is a base class?

Key term

How does a static variable differ from an instance variable?

Key term

What is an interface?

Key term

What is a primitive data type?

Key term

What are three reference types a Java programmer can use without writing a class?

Key term

What two things must every variable declaration give?

Key term

What value is stored by double d = 7 / 2;, and why?

Key term

Which five arithmetic operators does Java provide, and what does each do?

Key term

What is the value of true || false && false, and in which order are the two operators applied?

Key term

What is a class?

Key term

What does an inherited class receive from its base class?

Key term

What is meant by saying that attributes represent the properties of a class?

Key term

Why is a static variable normally accessed through the class name rather than through an object reference?

Key term

What does an interface contain?

Take Defining Data: Types, Variables and Classes further

The same content, four other ways.

Commonly confused

Pairs that lose marks when they are blurred together.

  • Abstract class vs Interface

    Abstract class: a type that may hold data and completed methods and can head only a single line of descent. Interface: a type that declares behaviour only, and any number of which may be promised by one implementer.

Questions from this topic

Each one with the model answer underneath.

  1. 1

    What is a primitive data type?

    Model answer

    A primitive data type is a type built into the language whose variable holds the value itself, rather than holding a reference to an object stored elsewhere.

  2. 2

    Which four integer primitive types does Java provide, and how wide is each?

    Model answer

    Java provides byte at 8 bits, short at 16 bits, int at 32 bits and long at 64 bits.

  3. 3

    What range of values can a signed 8-bit integer hold, and how does that range follow from the number of bits?

    Model answer

    Eight bits give 256 different patterns, and in a signed type half are used for negative values, so the range runs from −128 to 127.

  4. 4

    How many different values can be stored in 16 bits?

    Model answer

    Sixteen bits give 65 536 different values, because each extra bit doubles the number of patterns available.

  5. 5

    Which two primitive types hold real numbers in Java, and which of the two is the more precise?

    Model answer

    Java holds real numbers in float at 32 bits and double at 64 bits, and double is the more precise, keeping roughly fifteen significant figures against roughly seven.

  6. 6

    What values may a boolean variable hold, and how much information does a boolean actually carry?

    Model answer

    A boolean variable holds either true or false, so a boolean carries one bit of information even though a machine usually reserves a whole byte for it.

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.

Defining Data: Types, Variables and Classes revision questions

What does Defining Data: Types, Variables and Classes cover in CCEA A-Level Software Systems Development?
12 subtopics: primitive types and their storage, reference types, objects and null, declaring variables, scope and lifetime, type casting and conversion, arithmetic operators and expressions, relational and logical operators, operator precedence and evaluation order, objects as occurrences of a class, abstract, base and inherited classes, attributes and the properties of a class, static variables in a class and interfaces and class reusability. Each one has its own page with questions and model answers.
How is Defining Data: Types, Variables and Classes organised?
By the CCEA CL4 specification, subtopic by subtopic, so it matches the order you are taught it in.

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.