Save
Computer Science
Programming
OOP
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
willow
Visit profile
Cards (27)
What are the main concepts of object-oriented programming?
Class
,
object
,
instantiation
,
encapsulation
,
inheritance
View source
Why is the object-oriented paradigm used?
To organize code around
objects
and their interactions
View source
What are the object-oriented design principles?
Encapsulate
what varies
Favor composition over
inheritance
Program to interfaces, not implementation
View source
What is the focus of object-oriented programming (OOP)?
Objects
and their interactions
View source
What is an attribute in the context of an object?
A
data
item that
describes
the object
View source
What data types could attributes like suit and rank have?
String
for suit and rank
View source
What does a class definition do?
Defines
properties
of all
objects
of the same type
View source
What is instantiation in OOP?
Process of creating an object from a
class
View source
What is the purpose of a reference variable in OOP?
Holds the
memory address
of an object
View source
What is the role of methods in OOP?
Define the
behavior
of the object
View source
How does OOP differ from procedural programming when shuffling cards?
Deck shuffles itself rather than using a separate
subroutine
View source
What does the constructor in a class do?
Sets initial values for
attributes
View source
What is the name of the constructor method in Python?
__
init
__
View source
What does encapsulation achieve in OOP?
Binds
attributes
and methods to protect data
View source
What are getter and setter methods used for?
Accessing and modifying
attribute
values
View source
What is the significance of access modifiers in encapsulation?
Specifies which properties can be accessed
outside
the class
View source
How does inheritance benefit code management in OOP?
Reduces repeated code by inheriting
attributes
and methods
View source
What is polymorphism in OOP?
Ability
of a
method
to
exhibit
different
behaviors
View source
What is aggregation in OOP?
Defines a one-way "
has-a
" relationship
View source
How does composition differ from aggregation?
Composition specifies an "
is-part-of
" relationship
View source
What are the advantages and disadvantages of OOP?
Advantages:
Easier to conceptualize real-world
objects
Prewritten
classes
support code reuse
Easy to maintain due to
modularity
High level of data protection through
encapsulation
Disadvantages:
Can be complex for larger projects
Relies on
message passing
, affecting performance
May inherit methods that don't make sense contextually
Can consume a lot of memory
View source
What does UML stand for?
Unified
Modeling
Language
View source
What does a class diagram represent in OOP?
Classes
and their
relationships
in
pictorial
form
View source
What symbols are used in class diagrams for access modifiers?
+
,
-
,
#
View source
What is the purpose of inheritance diagrams?
To show
class hierarchies
and relationships
View source
How does encapsulation contribute to data hiding?
It restricts direct access to
attributes
View source
What is the role of message passing in OOP?
Objects call each other's
public methods
View source