Skip to main content
EnglandComputer ScienceSyllabus dot point

What are the core ideas of object-oriented programming?

Understand classes and objects, attributes and methods, instantiation, encapsulation, inheritance and polymorphism, and the principle of object-oriented design.

A focused answer to AQA A-Level Computer Science 4.1.5, covering classes and objects, attributes and methods, instantiation, encapsulation, inheritance and polymorphism, and the benefits of object-oriented design.

Generated by Claude Opus 4.89 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Classes and objects
  3. Encapsulation
  4. Inheritance and polymorphism
  5. Benefits of object-oriented design

What this dot point is asking

AQA wants you to define classes and objects, attributes and methods, explain instantiation, and describe encapsulation, inheritance and polymorphism, with the benefits of object-oriented design.

Classes and objects

CLASS Animal
  PRIVATE name
  PUBLIC PROCEDURE makeSound()
    OUTPUT "..."
  ENDPROCEDURE
ENDCLASS

dog = NEW Animal()   # instantiation: dog is an object

The distinction is like a cutter and the biscuits it stamps out: the class is written once and describes the shape, while many objects can be instantiated from it, each holding its own data. A Student class might be used to create thousands of student objects, all sharing the same methods but each with its own name and marks. Attributes are the data fields; methods are the subroutines that belong to the class and act on that data.

Encapsulation

Inheritance and polymorphism

Polymorphism is what lets a single loop call makeSound() on a list of mixed Animal objects and have each respond correctly, a dog barking and a cat meowing, without the loop needing to know which is which. This is powerful because new subclasses (a Cow) can be added later and the existing loop works with them unchanged, as long as they provide the expected method.

Benefits of object-oriented design

OOP models real-world entities directly, which makes large programs easier to design and understand because the code structure mirrors the problem. Encapsulation improves maintainability and protects data; inheritance reduces duplicated code by sharing common behaviour; polymorphism allows flexible, extensible code that works with new subclasses without change. A useful guiding principle is to encapsulate what varies behind clear interfaces, so that changes are localised and the rest of the program is insulated from them. These benefits are why OOP is the dominant paradigm for large software systems.

Exam-style practice questions

Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

AQA 20194 marksA program models vehicles. A Vehicle class has attributes and methods, and a Car class is derived from it. Explain how inheritance is used here and describe one benefit of using inheritance in this design.
Show worked answer →

Inheritance lets the Car class (the subclass) derive the attributes and methods of the Vehicle class (the superclass), so a Car automatically has the general vehicle properties such as numberOfWheels and a move method, and can then add or override its own, such as a bootCapacity attribute. This expresses the relationship "a Car is a Vehicle".

A benefit is code reuse: the shared attributes and methods are written once in Vehicle and inherited by Car and any other vehicle subclass (Lorry, Motorbike), avoiding duplication and making maintenance easier because a change to the shared behaviour is made in one place.

Markers reward correctly describing the subclass deriving from the superclass and a valid benefit (reuse, easier maintenance, clear hierarchy).

AQA 20225 marksExplain what is meant by encapsulation in object-oriented programming and discuss why making attributes private with public methods improves the design of a program.
Show worked answer →

Encapsulation is bundling an object's attributes (data) together with the methods that operate on that data inside a single class. It is usually combined with information hiding: the attributes are made private so they cannot be accessed directly from outside, and access is provided only through public methods such as getters and setters.

This improves the design in several ways. It protects the data from invalid changes, because a setter can validate a new value before storing it (rejecting a negative age, for example). It lets the internal representation change without breaking code that uses the class, because callers depend only on the public methods, not on how the data is stored. It also makes the class easier to reason about, since all the code that can alter its data is in one place.

Markers reward defining encapsulation as bundling plus information hiding, and at least two distinct design benefits (validation, hiding implementation, maintainability).

Related dot points

Sources & how we know this