Chapter 27 Object-oriented Progrmamming (OOP) Flashcards Preview

Computer Science A level > Chapter 27 Object-oriented Progrmamming (OOP) > Flashcards

Flashcards in Chapter 27 Object-oriented Progrmamming (OOP) Deck (9)
Loading flashcards...
1
Q

What is a class?

A

A class is a type or a blueprint for creating objects that has a record containing its attributes which are declared as private and has methods outside the record declared as public that operate on the attributes.

2
Q

What are attributes?

A

Attributes are data items of a class

3
Q

What are methods?

A

Methods are subroutines of a class that act on the data in the record

4
Q

What is an object?

A

An object is an instance of a class, for example
Object: MyCourse
Type: Course
An object becomes a course type if MyCourse = Course(“English”)

5
Q

What happens in encapsulation?

A

The methods operating, using or editing the attributes

6
Q

What is a constructor?

A

A constructor is a method that instantiates(impersonates) a new object.

7
Q

In what can we show a class, its attributes and methods?

A

We can represent a class, its attributes and methods in a class diagram.

8
Q

What is polymorphism?

A

Polymorphism is a behaviour of a code when reacting to different classes in the hierrarchy

9
Q

What is a containment?

A
Containment is a relationship between two classes where one class has a component that is of the other class type. 
Can be represented using a containment diagram