File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Why can't a statice method can be overriden to a non-static method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why can Watch "Why can New topic
Author

Why can't a statice method can be overriden to a non-static method?

Narasimha Rao B.
Ranch Hand

Joined: Aug 26, 2002
Posts: 205
Why can't a statice method can be overriden to a non-static method? and vice vera.


Narasimha
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
static method can be called even if the instance of class is not created. Since they are loaded at the time of class creation. So if you override static method by non static method , which can be called by creating instance of object.
does it make since to override it?
As a good programming practice. We should not use static method until it is required. Might be this one of the reason they are imposing such rule.


Sharing is learning
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Static methods can't be overridden anyway - they aren't polymorphic.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Originally posted by Ilja Preuss:
Static methods can't be overridden anyway - they aren't polymorphic.

You have done well, grasshopper.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why can't a statice method can be overriden to a non-static method?
 
Similar Threads
Static methods
Overridding Static Methods
Confusion!
Dan's Study Guide exam Ch-4 - Overriding static method question
static methods