2.4.8

Object-Oriented Languages

Test yourself on Object-Oriented Languages

Test your knowledge with free interactive questions on Seneca — used by over 10 million students.

Object-Oriented Languages

Object-oriented programming allows us to model real-world objects and manipulate them easily.

Object-oriented programming

Object-oriented programming

  • In object-oriented programming, most real-world objects, like cars, can be modelled.
  • Each object is an instance of the class. Objects contain:
    • Attributes: things we store about them e.g. the make and model of the car.
    • Methods: things the object can do e.g. starting the engine or indicating to turn.
Classes

Classes

  • A class forms a blueprint that we can use to instantiate (create) an object.
  • A car class could be instantiated for every car ever made.
  • Each object would have the same behaviours, but slightly different values in their attributes.
Inheritance

Inheritance

  • We can define a subclass from what we call the 'super class'.
    • These are sometimes known as child class and parent class.
  • In inheritance, the subclass inherits all of the attributes and methods of the superclass.
  • The subclass can have its own attributes and methods.
Example

Example

  • If we had a vehicle super class, we could have a subclass of car that would inherit all of the attributes and methods of the vehicle class.
  • The car subclass could add additional attributes such as colour and methods such as indicate_left that do not apply to the vehicle super class.
Jump to other topics
1

Components of a Computer

2

Software & Software Development

3

Exchanging Data

4

Data Types, Data Structures & Algorithms

5

Legal, Moral, Cultural & Ethical Issues

6

Elements of Computational Thinking

6.1

Thinking Abstractly

6.2

Thinking Ahead

6.3

Thinking Procedurally

6.4

Thinking Logically

6.5

Thinking Concurrently

7

Problem Solving & Programming

8

Algorithms

Practice questions on Object-Oriented Languages

Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.

  1. 1
Answer all questions on Object-Oriented Languages

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium