A

Admin • 833.24K Points
Coach

Q. What will be the output?
```python
class A:
def display(self):
print("Class A")

class B(A):
def display(self):
print("Class B")

obj = B()
obj.display()
```

  • (A) Class A
  • (B) Class B
  • (C) Error
  • (D) None
  • Correct Answer - Option(B)
  • Views: 19
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

The method `display` is overridden in class B, so `Class B` is printed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.