Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Computer science fundamentals

Object-Oriented Programming (OOP)

Object-oriented programming from first classes to design: objects, inheritance, interfaces, equality and lifetime, with programs run in 14 languages.

4 lessons to read 1 module

4 lessons: 4 free with Pro answers.

Examples run with Python 3.14.8, Pyodide 314.0.7, Node.js 24.21.0 and Java temurin-25.0.4+101.0.LTS.

Who it is for

Students preparing for object-oriented theory questions in interviews and university exams, and beginners who have written programs in their first language.

What you will be able to do

  • Explain every core OOP concept with correct, version-aware answers for placement interviews
  • Predict dispatch, construction order, copying and equality behaviour in Python, Java, C++ and TypeScript
  • Design small systems as cohesive classes with clear invariants, interfaces and relationships
  • Choose between inheritance, composition, interfaces and sealed types and justify the choice
  • Write classes whose equality, hashing, ordering and immutability obey their contracts
  • Manage object lifetime with RAII, try-with-resources, with blocks and using declarations
  • Build and test five object-oriented projects with automated checks

Revise and practise

Modules and lessons

What the labels mean

Free lesson, Pro answers
the whole lesson is free; the model answers to its interview questions open with a pass
Pro
opens with a Pro, Premium or Ultimate pass

Minutes are reading time.

What a pass opens in this track

8 interview answers. The same pass opens every other track and every Pro tool.

  1. Module 1

    Objects and classes

    Why objects exist, how classes create them in four languages, how variables refer to objects, and what belongs to the class rather than to each object.

    1. What object-oriented programming is and is not Beginner Free lesson, Pro answers: 20 minutes
    2. Classes, objects, fields and methods Beginner Free lesson, Pro answers: 15 minutes
    3. References, identity and aliasing Beginner Free lesson, Pro answers: 15 minutes
    4. Static members, class methods and factories Beginner Free lesson, Pro answers: 15 minutes

Related tools

Official documentation

More in Computer science fundamentals

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.