OOP module 8 Flashcards
The packaging of data and methods into a single component
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.
The variables of one class will be hidden from the other classes, accessible only through the
methods of the current class. This is called ____ ______.
data hiding
____________ is a process that enables one (1) class to acquire the properties (methods and
variables) of another.
Inheritance
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).
subclass , superclass
To inherit from a class, use the _______ keyword.
extends
___________ are not member methods, and so are not inherited by subclasses. However, the
constructor of the superclass is called when the subclass is ___________.
Constructors , instantiated
____________, which refers to the idea of “having many forms”, occurs when there is a
hierarchy of classes related to each other through inheritance.
Polymorphism
A call to a member method will cause a different implementation to be executed, depending on
the type of the object invoking the method.
Polymorphism
Data _________ provides the outside world with only essential information, in a process of
representing essential features without including implementation details
Abstraction - The concept of abstraction is that we focus on essential qualities, rather than the specific
characteristics of one (1) particular example
- In Java, abstraction is achieved using abstract _______ and ________
classes , interfaces
An _________ is an abstract class that contains only abstract methods.
interface
Use the __________ keyword to use an interface with your class.
implements