User interface language: English | Español

Date November 2018 Marks available 2 Reference code 18N.2.SL.TZ0.11
Level SL Paper 2 Time zone no time zone
Command term Outline Question number 11 Adapted from N/A

Question

Outline the use of data-hiding as a security feature in OOP.

[2]
a.

The Arrival object has two methods named compareWith.

Outline why calling the compareWith method does not cause a conflict.

[2]
b.i.

State the name of this OOP property.

[1]
b.ii.

Markscheme

Award up to [2 max].
Award [1] for stating encapsulation as an OOP property.
Award [1] for an elaboration.

Example answer:
Encapsulation allows to make instance variables (and methods) of a class private to that class;
So that the main program / other classes can't accidentally access / change the data in an object;

a.

Award up to [2 max].
The two methods have different parameters;
allowing the compiler to choose the correct one.

b.i.

Polymorphism

b.ii.

Examiners report

[N/A]
a.
[N/A]
b.i.
[N/A]
b.ii.

Syllabus sections

Option D: Object-oriented programming » D.2 Features of OOP
Option D: Object-oriented programming

View options