| Author |
using static method in polymorphism
|
Jithesh Kumar
Ranch Hand
Joined: Mar 09, 2010
Posts: 46
|
|
|
can a static method can be involved in polymorphism..i mean both static and dynamic polymorphism?
|
 |
Pramod P Deore
Ranch Hand
Joined: Jul 15, 2008
Posts: 629
|
|
|
Yes, static methods are involved in polymorphism.but only in static polymorhism (i.e static methods can be overloaded) but they are not involved in runtime polymorphism (i.e. static methods can't be overridden).
|
Life is easy because we write the source code.....
|
 |
Jithesh Kumar
Ranch Hand
Joined: Mar 09, 2010
Posts: 46
|
|
|
no i think static method can be overridden... i tried it but regarding overloading i needed the reply
|
 |
Pramod P Deore
Ranch Hand
Joined: Jul 15, 2008
Posts: 629
|
|
|
we can't override static methods, but we can overload static method.
|
 |
Lorand Komaromi
Ranch Hand
Joined: Oct 08, 2009
Posts: 276
|
|
bon jith wrote:i think static method can be overridden... i tried it
You can't override a static method, but you can hide it. This article explains the differences between overriding and hiding.
|
OCJP 6 (93%)
|
 |
Jithesh Kumar
Ranch Hand
Joined: Mar 09, 2010
Posts: 46
|
|
|
can you give me some example of polymorphism in static overloaded methods?...
|
 |
Muhammad Khojaye
Ranch Hand
Joined: Apr 12, 2009
Posts: 341
|
|
bon jith wrote:can you give me some example of polymorphism in static overloaded methods?...
see this FAQ
|
http://muhammadkhojaye.blogspot.com/
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16692
|
|
Please be careful with the term "polymorphism". There are lots of definitions out there -- and many are very loose as to include, method overloading, operator overloading, templates / generics, among them.
I would highly recommend that you use the one used by your professor (in your textbooks), or you could wind up failing, because you are using one of those "looser" and not accepted by your professor definitions.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Raj chiru
Ranch Hand
Joined: Aug 12, 2008
Posts: 140
|
|
|
see this Article Static
|
 |
 |
|
|
subject: using static method in polymorphism
|
|
|