Advertisements
Advertisements
प्रश्न
Explain the concept of overriding methods.
कोड लेखन
स्पष्ट कीजिए
Advertisements
उत्तर
Method overriding happens when a derived class defines a method with the same name as a method in its base class. The derived-class version is called when the method is invoked using a derived-class object.
class Person(object):
def show(self):
print("Person")
class Student(Person):
def show(self):
print("Student")
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
