Skip to content

Learn Object-Oriented Programming online, in Java, C++ or Python

Object-Oriented Programming is a way of designing programs, not a language of its own. You learn to model a problem as classes and objects, protect their data and reuse code safely, live and one-to-one, in the language your school or university course uses.

  • First 30-minute class free
  • Live, one-to-one, online
  • Female tutors on request
  • Reply within 24 hours

The OOP course at a glance

Short answers to the questions students and parents ask first. Each one is explained in more detail further down the page.

What is Object-Oriented Programming?

A way of designing programs as objects that hold their own data and behaviour, described by classes. It is a programming concept, not a language: Java, C++, Python and many other languages support it, and the same ideas apply in each.

Who should learn OOP?

Students on a university or school course that covers classes, students who have finished a first programming course, and self-taught programmers whose programs have become hard to change.

What do I need before I start?

You should be able to write a short program with variables, conditions, loops and functions in one language. If you cannot yet, start with a language course first.

Which topics does the course cover?

Classes and objects, constructors and methods, encapsulation, inheritance, polymorphism, abstraction, and practical class design with UML diagrams and an introduction to SOLID.

Which language are classes taught in?

Java, C++ or Python, whichever your course uses. Classes are live and one-to-one on Microsoft Teams or Zoom: you share your screen and write the code while the tutor explains and reviews.

How can I start learning OOP?

Book the free 30-minute introductory class with the form on this page or on WhatsApp. Tell us your course and language; we reply within 24 hours.

Who should take this OOP course?

  • University students on an OOP course, usually in the second semester
  • A Level, O Level and FSc students meeting classes for the first time
  • Students who have finished a first programming course and want the next step
  • Self-taught programmers whose programs have grown into one long file
  • Final-year students who want a cleaner design for their project

Where students often get stuck

  • Knowing the definitions of the four pillars, but not when to use each one
  • Mixing up a class and an object, or overloading and overriding
  • Making every field public and then losing track of who changed it
  • Class diagrams that never turn into working code
  • Inheritance used everywhere, so one change breaks five classes
  • Constructors, `this` and `self` that behave in unexpected ways

Prerequisites

  • Confident with variables, conditions, loops and functions in one language. You should be able to write a short program without help.
  • Arrays or lists, and passing values to functions.
  • You do not need to know Java, C++ and Python. One of them is enough, and lessons use the language your course uses.
  • New to programming? Start with the Python course, or the first part of the C++ course, and come to OOP afterwards.

What you need for lessons

  • A laptop or desktop computer. A phone or tablet is not enough for writing code.
  • A stable internet connection and Microsoft Teams or Zoom.
  • A quiet place where you can share your screen and talk with the tutor.

OOP course syllabus

The topics in the order they are usually taught. The tutor adjusts the order and depth to your level, and to your school or university syllabus if you share it.

  1. Classes and objects

    • A class as a blueprint and an object as one instance of it
    • Fields (state) and methods (behaviour)
    • Creating objects and calling their methods
    • References: two variables that point to the same object
  2. Constructors and methods

    • Constructors and giving every object a valid starting state
    • Overloaded constructors and default values
    • Instance methods, `this` in Java and C++, `self` in Python
    • Static fields and methods, and when to avoid them
    • Destructors and object lifetime in C++
  3. Encapsulation

    • Private fields and public methods
    • Access modifiers: public, private and protected
    • Validating input inside methods so an object cannot become invalid
    • Getters and setters, and when a better method name is clearer
  4. Inheritance

    • Base and derived classes, and the “is a” test
    • Calling the parent constructor with super
    • Overriding a method and extending its behaviour
    • Why deep inheritance trees become hard to change
  5. Polymorphism

    • One call, different behaviour: dynamic dispatch
    • Virtual functions in C++, and why they need a pointer or reference
    • Overloading compared with overriding
    • Working with a list of base-class objects
  6. Abstraction

    • Abstract classes and abstract methods
    • Interfaces in Java, pure virtual functions in C++, abstract base classes in Python
    • Programming to an interface instead of a concrete class
    • Hiding details that the rest of the program does not need
  7. Practical object-oriented design

    • Finding classes and responsibilities in a written problem
    • UML class diagrams, and turning them into code
    • Composition compared with inheritance
    • An introduction to the SOLID principles
    • Exceptions and error handling in an object-oriented program

One concept, three languages

OOP is taught in the language your course uses. Here is the same small class, a bank account that protects its balance, in each of them. The syntax changes; the ideas do not: private data, a constructor that sets a valid starting state, and a method that refuses bad input.

  • Java
    public class Account {
      private double balance;
    
      public Account(double opening) {
        balance = opening;
      }
    
      public void deposit(double amount) {
        if (amount <= 0)
          throw new IllegalArgumentException();
        balance += amount;
      }
    }
  • C++
    class Account {
      double balance;  // private by default
    
    public:
      explicit Account(double opening)
        : balance(opening) {}
    
      void deposit(double amount) {
        if (amount <= 0)
          throw std::invalid_argument("amount");
        balance += amount;
      }
    };
  • Python
    class Account:
        def __init__(self, opening):
            # private by convention
            self._balance = opening
    
        def deposit(self, amount):
            if amount <= 0:
                raise ValueError("amount")
            self._balance += amount

In lessons you would go on to add a savings account that inherits from this class, and a list of accounts that is processed polymorphically.

A practical way to learn

Model something real
Each idea is introduced through a small model, such as a library, a shop or a bank account, that you build and extend over several lessons.
Draw, then code
You sketch the classes and how they relate before writing them, so the design and the code stay connected.
Change it on purpose
You add a feature to working code and see which designs make that easy and which make it painful. That is where the pillars start to make sense.
Explain your design
You say aloud why a class exists and why it inherits or holds another one, the way a viva, a lab exam or an interview will ask you to.

Practice exercises and projects

Examples of models built in lessons. The tutor picks ones that suit your course, and you write every line yourself.

  • Library loans

    Books, members and loans as classes that refuse impossible actions, such as lending a book that is already out.

    Practises

    • Classes and objects
    • Encapsulation
    • Composition
  • Shapes and areas

    Circles, rectangles and triangles in one list, each working out its own area and perimeter.

    Practises

    • Inheritance
    • Polymorphism
    • Abstract classes
  • Payroll with interfaces

    Salaried staff, hourly staff and contractors are all paid through one interface, so adding a new kind of worker changes nothing else.

    Practises

    • Interfaces
    • Polymorphism
    • Programming to an interface
  • Refactor a long program

    Take a working program written as one long file and split it into classes with clear jobs, keeping it working at every step.

    Practises

    • Class design
    • UML
    • SOLID

Your assignments stay your own

The tutor explains, reviews your design and helps you find bugs, but does not write graded assignments, lab tasks or project code for you to submit.

Read our Academic Integrity Policy

What you can expect to learn

  • Explain classes, objects and the four pillars with examples of your own
  • Write constructors that leave every object in a valid state
  • Protect an object’s data with encapsulation and validation
  • Use inheritance and polymorphism where they help, and composition where they do not
  • Design a small set of classes from a written problem and draw it in UML
  • Read an existing object-oriented program and find where a change belongs

These are the aims of the lessons. Progress depends on where you start and how much you practise, and we never promise grades or results.

Suitable learning levels

OOP is an intermediate course: it builds on a first programming course. Where you start depends on what you already know.

  • Level: Beginner to intermediate

    Meeting classes for the first time

    You can program with functions, and your school or university course has just introduced classes. Lessons begin with objects, constructors and encapsulation.

  • Level: Intermediate

    Following a university OOP course

    Lessons follow your course outline through inheritance, polymorphism and abstraction, with practice in the style of your lab tasks and exams.

  • Level: Advanced

    Designing larger programs

    You know the syntax but struggle to structure a real program. Lessons focus on responsibilities, composition, UML and the SOLID principles.

Where to go next

OOP connects the language courses to the rest of Computer Science. These are the usual next steps, and the courses to take first if you need them.

  • Data Structures and Algorithms

    Build linked lists, trees and graphs from classes, and learn how fast each operation is.

  • C++ Programming

    The full C++ course, from first programs to pointers, classes and virtual functions.

  • Python Programming

    Learn programming from zero in Python before moving on to classes and objects.

  • FYP Mentoring

    Final-year students: plan the classes and structure of your project with a mentor.

Free guides

Your OOP tutor

OOP classes are taught by the programming tutors below. Each profile is published with the tutor’s consent. When you get in touch, we suggest a tutor who knows your course language.

  • Portrait of Ali Sher Abbasi, tutor at My Subject Hub

    Ali Sher Abbasi

    Tutor at My Subject Hub

    • BS (Computer Science), PMAS Arid University Rawalpindi
    • Data Structures and Algorithms certification, Zero To Mastery
    • Web development courses, Frontend Masters
    Teaching experience
    5 years
    Teaching languages
    English and Urdu
    Computer science and programming
    • Programming Fundamentals
    • C and C++
    • Java
    • JavaScript and Web Development
    • Object-Oriented Programming
    • Data Structures and Algorithms
    • Advanced Computer Science
    • Cybersecurity Fundamentals
    • FYP Mentoring
    School and college subjects
    • Mathematics
    • Science, Physics, Chemistry and Biology
    • English
    • Urdu
    Teaching approach
    Friendly and patient. Daily tasks and assignments, with quizzes to check progress, and we move to the next topic only when the previous one is crystal clear.
    Curricula and boards
    All curricula and boards
    Online availability
    Any time that suits the student
See all tutors

Fees and monthly plans

Per subject, per month, in US, Canadian, Australian or New Zealand dollars, and in Saudi riyals with 20% off for students in Saudi Arabia. Every plan starts with a free trial class.

Show prices for

International (USD)

For students in the United States and every other country without its own price list, in US dollars.

Each plan is for one subject. A second subject is a second plan.

  • First class free in every subject (30 minutes)
  • 15-day refund if the student isn’t happy with us, or for another valid reason
See all fees and policies

Questions · 9

OOP course questions

The questions students and parents ask us most, filed where you can find them. Pull a card to read it.

How can I learn object-oriented programming?

Learn the basics of one language first, then study OOP in that language by designing small classes and building on them. Work through the four core ideas in order, encapsulation, inheritance, polymorphism and abstraction, and write and change code for each instead of only reading definitions. At My Subject Hub you can learn OOP live and one-to-one online in Java, C++ or Python, following your own course, and the first 30-minute class is free.

Is OOP a programming language?

No. Object-Oriented Programming is a way of organising a program around classes and objects. Many languages support it, including Java, C++, Python, C# and JavaScript. We teach it in Java, C++ or Python, whichever your course uses, and the ideas carry over to the others.

Which language should I learn OOP in?

The one your course or exam uses. If you are free to choose, Java makes the ideas very visible because everything lives in a class, C++ adds memory and virtual functions, and Python lets you focus on design with less syntax. The tutor can show a concept in a second language when that helps.

Am I ready for OOP?

If you can write a program with loops, functions and arrays on your own, yes. If not, a few lessons of a language course first will make OOP much easier.

See the Python course

What is the difference between overloading and overriding?

Overloading means several methods with the same name but different parameters in one class; the compiler picks one from the arguments. Overriding means a subclass replaces a method it inherited with the same signature; the object’s real type decides which runs. Both are covered, with code, in the polymorphism lessons.

Can lessons follow my semester or exam syllabus?

Yes. Share your course outline or past papers, and the tutor follows its order of topics and uses the same style of questions and lab tasks for practice.

What should I learn after OOP?

Data Structures and Algorithms is the usual next course, because linked lists, trees and graphs are built from classes. Final-year students can also bring their project design to the FYP mentoring sessions.

Read about the Data Structures and Algorithms course

How long does it take, and how much does it cost?

There is no fixed length. It depends on where you start and what your course covers; the tutor suggests a plan after the free 30-minute class. OOP uses the monthly plans, from ⁦$40⁩ a month (⁦SAR 120⁩ in Saudi Arabia).

See fees and plans

Can I ask for a female tutor?

Yes. Female tutors are available on request, and so are male tutors. Tell us your preference when you get in touch, and we confirm a matching tutor before the free class.

Not in the drawer? Send us your question and we reply within 24 hours.

Ask us

Book a free introductory OOP class

Meet the tutor, look at a small class together, and find out where to start. Tell us your course and language, and we will arrange a time.

What happens next

  1. We reply within 24 hours, on WhatsApp or by email.
  2. You agree a time for the free 30-minute class with the tutor.
  3. In the class the tutor checks your level, you write a little code together, and you get a suggested starting point.
  4. There is no obligation to continue after the free class.

Tell us about the student

Just your phone number or email. That’s all we need; everything else is optional.

  • No credit card required
  • Free 30-minute class
  • Reply within 24 hours

We use these details only to reply to you and arrange classes. How we handle your information