aspose file tools
The moose likes Beginning Java and the fly likes Can static methods be overridden Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Can static methods be overridden" Watch "Can static methods be overridden" New topic
Author

Can static methods be overridden

Venkata Sirish
Ranch Hand

Joined: Apr 09, 2007
Posts: 112
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
Katrina Owen
Sheriff

Joined: Nov 03, 2006
Posts: 1334
    
  11
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 ]
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9940
    
    6

and of course, what happens when you try it?


Never ascribe to malice that which can be adequately explained by stupidity.
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
the methods static aren't overriden. because the methods static they pertence the class


Brazil - Sun Certified Java Programmer - SCJP 5
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
Parthiban Malayandi
Ranch Hand

Joined: Apr 15, 2008
Posts: 67
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 ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Can static methods be overridden
 
Similar Threads
fun with main() and abstract
JavaCaps mock 1 Q:39
method overriding
Static methods can be overridden by static methods only?
Can a main method be inherited?