Next ❯ ❮ Previous

Python MethodOverriding


WHEN A FUNCTION AND ITS SIGNATURE IN PARENT CLASS AND THE FUNCTION
AND ITS SIGNATURE IN SUB CLASS IS EXACTLY SAME,THEN THE FUNCTION IN
CHILD CLASS IS CALLED AS OVERIDDEN THIS IS KNOWN AS FUNCTION OVERIDING
OR METHOD OVERIDING.


Example2.py

  class Vehicle:
    def move(self):
      print("Vehicle is running")

  class Car(Vehicle):
    def move(self):
      print("Car is running")

  obj=Car()
  obj.move()


Output

Car is running
Next ❯ ❮ Previous

Follow Us




  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved