OOP module 8 Flashcards

1
Q

The packaging of data and methods into a single component

A

Encapsulation -The idea behind encapsulation is to ensure that implementation details are not visible to users.

To achieve encapsulation in Java, declare the class’ variables as private and provide public
setter and getter methods to modify and view the variables’ values.

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

The variables of one class will be hidden from the other classes, accessible only through the
methods of the current class. This is called ____ ______.

A

data hiding

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

____________ is a process that enables one (1) class to acquire the properties (methods and
variables) of another.

A

Inheritance

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

The class inheriting the properties of another is the ______ (also called derived class, or child
class); the class whose properties are inherited is the ________ (base class, or parent class).

A

subclass , superclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
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
6
Q

___________ are not member methods, and so are not inherited by subclasses. However, the
constructor of the superclass is called when the subclass is ___________.

A

Constructors , instantiated

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

____________, which refers to the idea of “having many forms”, occurs when there is a
hierarchy of classes related to each other through inheritance.

A

Polymorphism

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

A call to a member method will cause a different implementation to be executed, depending on
the type of the object invoking the method.

A

Polymorphism

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

Data _________ provides the outside world with only essential information, in a process of
representing essential features without including implementation details

A

Abstraction - The concept of abstraction is that we focus on essential qualities, rather than the specific
characteristics of one (1) particular example

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  • In Java, abstraction is achieved using abstract _______ and ________
A

classes , interfaces

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

An _________ is an abstract class that contains only abstract methods.

A

interface

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

Use the __________ keyword to use an interface with your class.

A

implements

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