stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Mastering Object-Oriented Programming P1 Flashcards | StudBud
Explore
/
Mastering Object-Oriented Programming P1
Mastering Object-Oriented Programming P1
12 terms
·
StudBud Administration
Test your knowledge and become an expert in Object-Oriented Programming concepts
Flashcards
12 cards
F
Practice quiz
P
Host live
L
Questions
12
Answers
1
What does the __init__() in Python classes
?
A default method to destroy all classes
An instance method for object initialization
Just a normal function with a weird name
A destructor
2
Which is a benefit of getters and setters?
Protects data
Increases complexity
Eliminates methods
Reduces performance
3
What is an attribute in OOP?
A property
A function
An object
A class
4
True or false: A class method uses 'self' as a parameter.
False
True
5
Inheritance in OOP allows:
A class to inherit behaviors but not properties
A class to inherit properties and behaviors from one parent class
A class to inherit properties and behaviors from multiple parent classes
A class to inherit only properties but not behaviors
6
True or false: Python allows multiple inheritance.
True
False
7
What is 'self' in Python classes?
A method
A keyword
Another object
Reference to the instance
8
In UML Class Diagrams, what is '+' and '-' attributes
+ is public, - is private
- is public, + is privtae
+ is protected, - is private
- is private, + is protected
9
In UML Class Diagrams, what is '#' mean?
# is sealed
# is overriden
# is internal
# is protected
10
True or false: A subclass inherits from a superclass.
False
True
11
What does the 'super()' function do?
Creates new objects
Defines new classes
Deletes attributes
Calls parent methods
12
What is encapsulation in the context of Python classes?
Declaring a class as a subclass of another class.
The inheritance of attributes from one class to another.
Restricting access to certain attributes and methods within a class.
The process of converting a class instance to a string.