Imperative Programming HT23, Object-oriented programming
Flashcards
What is the idea of modularisation in object-oriented programming?
All functionality and data of a “thing” are held in one place.
What is the idea of abstraction in object-oriented programming?
Functionality is specfied in its more general form, free from any implementation details.
What is the idea of encapsulation in object-orientied programming?
Implementation details are hidden from the caller.
What is an object in object-oriented programming?
A software artefact with some data, and some operations on that data.
What is a class in object-oriented programming?
A template for objects.
Say you have a trait Book
and want to define a class MapBook
that extends it. How do you do this in Scala?
Book
and want to define a class MapBook
that extends it. How do you do this in Scala?class MapBook extends Book { ... }