OOP Flashcards
Is a programming paradigm based on the conecpt of “objects”, which can contain data and code to manipulate data.
Object-Oriented Programming
Give the 4 principles of OOP
Encapsulation, Inheritance, Abstraction, Polymorphisim
Is a process of wrapping code and data together into a single unit
Encapsulation
Makes sure that “sensitive” data is hidden from users.
Encapsulation
To achive Encapsulation: Declare class variables/attributes as ____
Private
To achive Encapsulation: provide ___ and ____ method to access and update the value of a private variable.
Get and Set
___ method returns the variable value
Get
____ mehtod sets the value.
Set
Attributes can be made read-only, if u only use the ___ method
Get
Attributes can be made write-only, if u only use the ___ method
Set
The class that inherits from another class
Subclass
The class being inherited from
Superclass
To inherit from a class, use the ____ keyword
Extends
_____ means “many forms” and it occurs when we have many class that are related to each other by inheritance
Polymorphsim
_____ is the process of hiding certain details and showing only essential info to the user.
Abstraction
Abstraction can be achieved with either _____ classes or _____
Abstract classes or Inherfaces
Abstract ____ is a restricted class that cannot be used to create object
Class
Abstract ____ only be used in an abstract c;ass, and does not have a body.
Method