• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Can static methods be overridden

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is Venkat. I have a doubt regarding " can static methods be overridden " . Please present a reason for your answer.



Thanks in Advance,
Venkat
 
Sheriff
Posts: 1367
18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Venkat,

Where exactly are you stuck? Are you trying to override a static method and getting strange behavior? If so, what are you observing, and why does it surprise you?

We are happy to help out, but you do need to show some effort, since we generally hold to the view that you will learn something better if you have to think about it than if you are just given the answer.

You may find something of interest in this article.

Cheers,
Katrina
[ April 17, 2008: Message edited by: Katrina Owen ]
 
lowercase baba
Posts: 13003
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and of course, what happens when you try it?
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the methods static aren't overriden. because the methods static they pertence the class
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends ,

I also learned that we can't override static method .

Here is a simple program to test it



This is even stated in JavaRanch FAQ
http://faq.javaranch.com/view?OverridingVsHiding
[ April 17, 2008: Message edited by: Parthiban Mahiby ]
 
Arthur, where are your pants? Check under this tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic