31. |
Which of the following best describes polymorphism?
|
||||||||
Answer:
Option (d) |
32. |
What is the biggest reason for the use of polymorphism?
|
||||||||
Answer:
Option (c) |
33. |
What is the use of duck typing?
|
||||||||
Answer:
Option (c) |
34. |
A class in which one or more methods are only implemented to raise an exception is called an abstract class.
|
||||
Answer:
Option (a) |
35. |
Overriding means changing behaviour of methods of derived class methods in the base class.
|
||||
Answer:
Option (b) |
36. |
What will be the output of the following Python code?
class A: def __init__(self): self.multiply(15) print(self.i) def multiply(self, i): self.i = 4 * i; class B(A): def __init__(self): super().__init__() def multiply(self, i): self.i = 2 * i; obj = B()
|
||||||||
Answer:
Option (d) |
37. |
What will be the output of the following Python code?
class Demo: def check(self): return " Demo's check " def display(self): print(self.check()) class Demo_Derived(Demo): def check(self): return " Derived's check " Demo().display() Demo_Derived().display()
|
||||||||
Answer:
Option (a) |
38. |
Which of the following statements is true?
|
||||||||
Answer:
Option (a) |
39. |
Which of these is not a fundamental feature of OOP?
|
||||||||
Answer:
Option (c) |
40. |
Which of the following is the most suitable definition for encapsulation?
|
||||||||
Answer:
Option (b) |