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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
