Module 2: Introduction to Object Oriented Programming (cont.) Flashcards

1
Q

_____ can be defined as the process where one class acquires the properties (methods and
fields) of another. With the use of _____ the information is made manageable in a hierarchical
order.

A

Inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The class which inherits the properties of other is known as _____ (derived class, child class).

A

subclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The class whose properties are inherited is known as _____ (base class, parent class).

A

superclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

To inherit from a class, use the _____ keyword.

A

extends

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

If you don’t want other classes to inherit from a class, use the _____ keyword.

A

final

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

_____ is the ability of an object to take on many forms.

A

Polymorphism. The most common use of
polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The meaning of _____, is to make sure that “sensitive” data is hidden from users.

A

Encapsulation.
To achieve this, you must:
* declare class variables/attributes as private
* provide public get and set methods to access and update the value of a private variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The _____ method returns the variable value, and the _____ method sets the value.

A

get and set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

_____ is the process of hiding certain details and showing only essential information to the user.

A

Abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

_____ is a restricted class that cannot be used to create objects (to access it, it must be inherited from
another class).

A

Abstract class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

_____ can only be used in an abstract class, and it does not have a body. The body is provided by
the subclass (inherited from)

A

Abstract method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly