Рет қаралды 21,078
WHY POLYMORPHISM WITH REAL TIME EXAMPLE # OOPS TUTORIAL IN TAMIL....
This video provides the theoretical explanation of polymorphism with real-life examples. For detailed explanation on this topic with java programs refer polymorphism in java and runtime & compile time polymorphism.
Polymorphism means to process objects differently based on their data type.
In other words it means, one method with multiple implementation, for a certain class of action. And which implementation to be used is decided at runtime depending upon the situation (i.e., data type of the object)
This can be implemented by designing a generic interface, which provides generic methods for a certain class of action and there can be multiple classes, which provides the implementation of these generic methods.
Lets us look at same example of a car. A car have a gear transmission system. It has four front gears and one backward gear. When the engine is accelerated then depending upon which gear is engaged different amount power and movement is delivered to the car. The action is same applying gear but based on the type of gear the action behaves differently or you can say that it shows many forms (polymorphism means many forms)
Polymorphism could be static and dynamic both. Method Overloading is static polymorphism while, Method overriding is dynamic polymorphism.
Overloading in simple words means more than one method having the same method name that behaves differently based on the arguments passed while calling the method. This called static because, which method to be invoked is decided at the time of compilation
Overriding means a derived class is implementing a method of its super class. The call to overriden method is resolved at runtime, thus called runtime polymorphism
c tutorial link - • C Programming Tutorial...
oops link - • Learn Object Oriented ...
html5 link - • 1# Introduction to HTM...
css3 link - • PART-1 INTRODUCTION TO...
javascript link - • PART-1 INTRODUCTION TO...
python link • #1 - Python Tutorial i...
c tricks - • ADD TWO NUMBERS WITHOU...
c interview questions - • Find The Output Of the...
sample program - • HOW TO WRITE C PROGRAM...
c++ program - • PART-01 INTRODUCTION T...
like our face book page..
/ santratechspot
--------------------------------------------------------------------------------
send request our channel official facebookprofile...
/ santra.techspot.5
---------------------------------------------------------------------------------
#santratechspot #oops #polymorphism