ExamVeda
Login
Home
41
Which of the following is the most suitable definition for encapsulation?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
42
What is the purpose of the super() function in object-oriented programming?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
43
What is the purpose of the super() function in object-oriented programming?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
44
The purpose of name mangling is to avoid unintentional access of private class members.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
Which of these is a private data field?
def Demo:
def __init__(self):
    __a = 1
    self.__b = 1
    self.__c__ = 1
    __d__= 1
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
46
What will be the output of the following Python code?
class A:
    def __init__(self,x=3):
        self._x = x        
class B(A):
    def __init__(self):
        super().__init__(5)
    def display(self):
        print(self._x)
def main():
    obj = B()
    obj.display()
 
main()
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
47
Private members of a class cannot be accessed.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
48
What is the purpose of the @property decorator in object-oriented programming?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
49
What is the purpose of using encapsulation in object-oriented programming?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
50
How is polymorphism implemented in object-oriented programming?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board