Back to Topic 7.1 — OOP: a single class
7.1.1Computer Science SL5 flashcards

Fundamentals of OOP

Practice Flashcards

Flip to reveal answers
Card 1 of 57.1.1
7.1.1
Question

What is object-oriented programming?

Click to reveal answer

Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.

All 5 Flashcards — Fundamentals of OOP

Sign up free to track progress and get spaced-repetition review schedules.

Card 1definition

Question

What is object-oriented programming?

Answer

An approach that keeps a thing's data and the operations on it in one place. A book's title and its borrow() method live together, rather than the data in one structure and the code elsewhere.

Card 2comparison

Question

What is the difference between a class and an object?

Answer

A class is the template, saying what every one of this kind will have and can do; it holds no values itself. An object is one actual thing made from that class, with its own values.

Card 3comparison

Question

What is the difference between inheritance and polymorphism?

Answer

Inheritance is reusing what a more general class already has — Ebook takes Book's title and author. Polymorphism is the same method call answered appropriately by each kind. Inheritance often makes polymorphism possible, but they are different ideas.

Card 4concept

Question

Give two advantages and two disadvantages of OOP.

Answer

Advantages: it models real things with data and behaviour, and inheritance gives reuse with no copied code. Disadvantages: the class structure must be designed before coding, and it is more code than a small task needs.

Card 5concept

Question

When is OOP not worth using?

Answer

For a short script with no real entities to model — reading a file and printing a total gains nothing from classes while still paying the design and code overhead.

Track your progress with spaced repetition

Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.

Start Free