10 Review Questions and Answers
Graded A+
What is the main concept behind Object-Oriented Programming?
Encapsulation
✔✔The use of classes and objects
Procedural programming
Separation of concerns
Which of the following is a key feature of Object-Oriented Programming?
✔✔Inheritance
Concurrency
Memory management
Low-level programming
What does inheritance allow in Object-Oriented Programming?
✔✔One class to inherit attributes and methods from another class
Multiple classes to inherit from a single class
1
,A class to inherit multiple attributes from different classes
The use of functions only
What does the `__init__()` method do in Python?
Defines a method to call when an object is deleted
It’s used to modify the behavior of methods
✔✔Initializes a new object of a class
It returns the memory location of an object
What does the term "polymorphism" mean in OOP?
The ability to inherit properties
✔✔The ability to use methods from different classes with the same name
The way objects are structured
The process of combining different classes
Which of the following allows you to hide the internal object details from outside code in OOP?
Inheritance
✔✔Encapsulation
2
, Polymorphism
Abstraction
What does abstraction mean in Object-Oriented Programming?
✔✔Hiding the complex implementation details and showing only the necessary features
Ensuring all data members are public
Sharing objects between multiple programs
Using classes to manage multiple variables
What is the purpose of a method in an OOP class?
It defines the data members of the class
It initializes the class
✔✔It defines the behavior of objects
It’s used to create a new object
In Python, which symbol is used to define a class?
{}
✔✔class
3