Signed up recently but had issues with the confirmation email?

Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.

Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.

Revision notesQuestionsFor schools
Revise Computing
Log inStart revising free
Revision notesQuestionsFor schoolsLog in

© 2026 Revise Computing · revisecomputing.co.uk

Worried about something?Question Bank UpdatesPrivacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).

Knowledge/A Level/H446/01 Computer systems/Types of Programming Language/Object-oriented languages

Object-oriented languages: classes, objects, methods, attributes, inheritance, encapsulation, polymorphism

Object-oriented languages (see appendix 5d for pseudocode style) with an understanding of classes, objects, methods, attributes, inheritance, encapsulation and polymorphism

1.2.4 Types of Programming Language

Practise exam questions

Types of Programming Language — Note 5 of 5

Candidates need to understand object-oriented code (as specified in the pseudocode guide). They need to have an understanding of classes, objects, attributes and methods. They need to understand the difference between private and public attributes and methods. Candidates need to understand encapsulation and the use of get and set methods to access private attributes. Candidates need to understand the purpose and principles of inheritance. Candidates need to have an understanding of polymorphism and how it can be used within a program. Candidates need to be able to read, trace, amend and write code that makes use of these object-oriented techniques

What you need to know

Object-oriented programming (OOP) models a system as a collection of objects that combine data and the methods that act on it. You need to understand the key OOP concepts and be able to read, trace, amend and write code using OCR's object-oriented pseudocode style.

What to know

  • A get method RETURNS the attribute's value. It takes no parameter, unless it returns one element of an array attribute, when it takes the index. A set method takes the new value as a PARAMETER and assigns it to the attribute, and can validate it first (e.g. reject a negative price).
  • Benefits of OOP: code is reusable through inheritance; encapsulation makes code more secure and easier to maintain; classes can be developed and tested independently.
  • Class vs record: both group named data items, which can be of different types. A class also has methods, can make its attributes private, and is a template for creating objects.

Code examples

OCR pseudocode: encapsulation, inheritance and polymorphism
text
class Animal
    private name
    public procedure new(givenName)
        name = givenName
    endprocedure
    public function getName()
        return name
    endfunction
    public function speak()
        return "..."
    endfunction
endclass

class Dog inherits Animal
    public procedure new(givenName)
        super.new(givenName)
    endprocedure
    public function speak()        // overrides Animal.speak (polymorphism)
        return "Woof"
    endfunction
endclass

myDog = new Dog("Rex")
print(myDog.getName() + " says " + myDog.speak())

Key terms

Class

A template or blueprint that defines the attributes and methods that objects of that type will have.

Object

An instance of a class, with its own values for the attributes.

Attribute

A variable belonging to a class/object that holds its data.

Method

A subroutine belonging to a class that defines the behaviour of an object.

Constructor

A special method that runs when an object is created to set its initial attribute values. In OCR pseudocode it is a procedure called new.

Encapsulation

Keeping an object's attributes private so they can only be accessed or changed through its public methods (getters and setters). This protects the data from accidental or invalid changes.

Inheritance

A subclass takes on the attributes and methods of a superclass, and can add its own. In OCR pseudocode: class Dog inherits Pet.

Polymorphism

Objects of different classes can respond to the same method call in different ways, e.g. a subclass overriding a method of its superclass.

Exam technique

  • Tip:In OCR pseudocode, super.new(...) calls the superclass constructor, and objects are created with objectName = new ClassName(parameters).
  • Mistake:Confusing a class with an object. The class is the template; the object is a specific instance created from it. Objects don't INHERIT from their class: inheritance is a subclass taking on a superclass's attributes and methods.
  • Mistake:Saying private attributes cannot be changed. They can, but only through the class's own public methods, such as a setter. Nor does 'public' mean the system's users can use it: public and private say which CODE can use an attribute or method. Public ones can be used by code outside the class; private ones only by the class's own methods.
  • Tip:When describing encapsulation or inheritance for a given class, use its actual attribute and method names (e.g. 'name is private and is read through getName()'). When asked for two advantages, make them genuinely different.

Past exam questions

  • June 2026Paper 2Q9(b)(i)2marks
  • June 2023Paper 2Q9(b)(iii)2marks
  • November 2021Paper 1Q7(c)(i)3marks
  • November 2021Paper 2Q5(a)1mark
  • November 2021Paper 2Q5(b)2marks
  • November 2020Paper 1Q2(b)3marks
  • November 2020Paper 1Q2(c)4marks
  • November 2020Paper 2Q6(b)(ii)2marks
  • November 2020Paper 2Q6(e)12marks
  • June 2018Paper 1Q7(b)(ii)2marks
  • June 2018Paper 1Q7(b)(iii)2marks
  • June 2018Paper 2Q6(a)(i)3marks
  • June 2018Paper 2Q6(b)(ii)2marks

Ready to test yourself?

Practise 1.2.4 questions
← Previous noteModes of addressing memory: immediate, direct, indirect and indexed1.2.4 Types of Programming LanguageNext topic →Lossy vs lossless compression1.3.1 Compression, Encryption and Hashing

Back to Types of Programming Language

Types of Programming Language

Note 5 of 5

  1. 1The need for and characteristics of a variety of programming paradigms
  2. 2Procedural languages
  3. 3Assembly language and the Little Man Computer instruction set
  4. 4Modes of addressing memory: immediate, direct, indirect and indexed
  5. 5Object-oriented languages: classes, objects, methods, attributes, inheritance, encapsulation, polymorphism
Topic overview