By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,650 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,650 IT Pros & Developers. It's quick & easy.

Why we cannot override static method of class?

P: 5
Can any one tell clearly? thanks
Sep 9 '12 #1
Share this Question
Share on Google+
3 Replies


zmbd
Expert Mod 5K+
P: 5,397
The clearest, and simplest, answer I have for this...
and I may be wrong here as I don't do very much JAVA work:

You cannot override static method because overriding is based upon binding at runtime and static methods are bonded at compile time.

http://docs.oracle.com/javase/tutori...classvars.html

-z
Sep 9 '12 #2

P: 5
I reffered this link
Your answer and this link answer seems to same
http://geekexplains.blogspot.in/2008...s-in-java.html

Thanks Zmbd
Sep 9 '12 #3

zmbd
Expert Mod 5K+
P: 5,397
Your answer and this link answer seems to same
saravana
I reviewed your link... basically the same answer just different words - and a little more detail. You asked for a simple answer.

That the answers would be similar shouldn't surprise anyone.... it is after-all the same programing language.

-z
Sep 9 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.