tag:blogger.com,1999:blog-8712770457197348465.post5885606115451800369..comments2024-03-18T21:47:21.135-07:00Comments on Javarevisited: What is polymorphism in Java? Method overloading or overriding?javin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-8712770457197348465.post-4464127398968414262015-03-26T09:30:00.941-07:002015-03-26T09:30:00.941-07:00Polymorphism is a result of inheritance. It's ...Polymorphism is a result of inheritance. It's all about overriding a method; it has absolutely nothing to do with overloading or interfaces! Polymorphism is also the most important and exciting thing about programming. It is also perhaps the single definition of the phrase "object oriented". If it ain't "polymorphic" it ain't "object oriented". Period!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-38294730226716211912014-05-27T10:17:47.721-07:002014-05-27T10:17:47.721-07:00I am going to define-- What is polymorphism ? Wh...I am going to define-- What is polymorphism ? When an object shows different behavior at different class level is called polymorphism. Here behavior refers to the method. This can be achieved in two ways. First using method overloading i.e when we overload methods they must be differ either in argument length or argument type. Whenever we call the overloaded method, we specify which one Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-15683725027968320992013-09-22T01:05:34.915-07:002013-09-22T01:05:34.915-07:00What is polymorphism?
Ability of an java object t...What is polymorphism?<br /><br />Ability of an java object to take more than one form is polymorphism.<br /><br />What does that mean?<br /><br />Let's take an practical example to understand this <br /><br />Say we have an living being called animal who is a horse .Now I can say<br /><br />Horse is running <br /> OR<br />Animal is running<br /><br />both are correct .Thus single living MANOJ KUMARhttps://www.blogger.com/profile/00421517842858762886noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-21841317623808198432013-07-15T04:30:53.617-07:002013-07-15T04:30:53.617-07:00@Gauri -- You are right, method overloading is als...@Gauri -- You are right, method overloading is also a type of polymorphism. Polymorphism can be implemented by either static binding or late binding. Static binding is nothing but compile time polymorphism (achieved via method overloading) where the actual object is known during compile time.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-12681089099172335372013-06-27T00:38:12.472-07:002013-06-27T00:38:12.472-07:00Hello Javin, is method overloading is really examp...Hello Javin, is method overloading is really example of polymorphism in Java? I have asked this question in an interview. I said yes because polymorphism means many forms and overlaoded method s has same name but different behaviors, but interviewer was not agreed. he says function overloading is not polymorphism because it's not based on type of object. Please help with this confusionGaurinoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-74201011250161234522012-10-29T21:56:25.444-07:002012-10-29T21:56:25.444-07:00What is difference between Polymorphism and overlo...What is difference between Polymorphism and overloading or Polymorphism to overrriding in Java ? Are Polymorphism and overriding are same thing ? Some people says there is difference between Overloading and Polymorphism and its not a true form of Polymorphism, What is your opinion ?Pratteknoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-12156539060271647562012-10-22T18:28:07.157-07:002012-10-22T18:28:07.157-07:00wat is use of interface when we hav to give the im...wat is use of interface when we hav to give the implementation itself..Anonymoushttps://www.blogger.com/profile/08902239440136113808noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-7909558806380644762012-09-23T22:14:44.811-07:002012-09-23T22:14:44.811-07:00If I have a interface called HumanInterface and a ...If I have a interface called HumanInterface and a class called Man that implements from HumanInterface whats the difference between <br />Man m = new Man();<br />and <br />HumanInterface m = new Man();Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-33452581408600210992012-07-25T04:57:53.114-07:002012-07-25T04:57:53.114-07:00polymorphism is something where one message is men...polymorphism is something where one message is ment in many waysAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-44854163668374589962012-04-24T02:15:41.406-07:002012-04-24T02:15:41.406-07:00we have two types of polymorphisms one is static a...we have two types of polymorphisms one is static and another one is dynamic. Overloading is example for static polymorphism and Overriding is example for dynamic polymorphismSai Venkathttps://www.blogger.com/profile/09846606447416899332noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-68354485874482756772012-02-09T19:20:24.655-08:002012-02-09T19:20:24.655-08:00My understanding is method overloading is not a po...My understanding is method overloading is not a polymorphism and only method overriding is known as polymorphismSKhttps://www.blogger.com/profile/17868683155121108832noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-612996823544064832012-01-17T04:54:22.048-08:002012-01-17T04:54:22.048-08:00Hi Joselyn you may like to check my post Differenc...Hi Joselyn you may like to check my post <a href="http://javarevisited.blogspot.com/2011/12/method-overloading-vs-method-overriding.html" rel="nofollow">Difference between method overloading and overriding with example</a>Javin @ why main is declared static in javahttp://javarevisited.blogspot.com/2011/12/main-public-static-java-void-method-why.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-30469711782134494132011-09-07T07:05:23.245-07:002011-09-07T07:05:23.245-07:00Thanks Prashant,yes you are correct method overloa...Thanks Prashant,yes you are correct method overloading is a static polymorphism which resolves on compile time while method overriding resolved during run time.Javin @ stringbuffer vs Stringbuilderhttp://javarevisited.blogspot.com/2011/07/string-vs-stringbuffer-vs-stringbuilder.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-42675382889449254822011-09-06T08:25:01.660-07:002011-09-06T08:25:01.660-07:00Both are the valid implementation of polymorphism ...Both are the valid implementation of polymorphism concept. <br />Method Overloading demonstrates static polymorphism and Method Overriding is used in Dynamic Method Dispatch for implementation of Dynamic Polymorphism.Prashant Neharkarhttps://www.blogger.com/profile/08413931932451246702noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-51899225357792739262011-08-21T18:37:16.506-07:002011-08-21T18:37:16.506-07:00what is the difference in method overloading and m...what is the difference in method overloading and method overriding, does both comes under polymorphism ?Ravinoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-31430666189040286272011-08-19T19:45:30.922-07:002011-08-19T19:45:30.922-07:00Polymorphism in Java is implemented in java with t...Polymorphism in Java is implemented in java with the use of interface, abstract class, method overloading and method overriding. you should also not forget that Inheritance also gives you ability to implement polymorphism by providing you substitution capability where a Base class can hold reference of derived class.Anonymousnoreply@blogger.com