Re: Static methods overridden !!



Ravi wrote:
Technically speaking static methods ARE OVERRIDDEN, not at the object
level ofcourse at the class level as invocation of statics is not
object dependent. Also, we cannot take the advantage of polymorphism
in case of the static methods but thats not the point. Static methods
are overridden.

Speaking in terms of the JLS, static methods are hidden, not overriden. See [1] for details.

Bye
Michael

[1] <http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8>
.



Relevant Pages

  • Re: Microsoft Data Access Block and static methods
    ... a lock would be needed. ... >classes instead of using statics, or that it's ok to use statics in ... It is OK to use static methods in a multithreaded app, ... very careful is when using static fields. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Microsoft Data Access Block and static methods
    ... a lock would be needed. ... >classes instead of using statics, or that it's ok to use statics in ... It is OK to use static methods in a multithreaded app, ... very careful is when using static fields. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Static versus Singleton versus seperate Instantiations...
    ... Use public static methods instead of a ... > while working in a probject, you realise that some string handling stuff ... > - use a singleton structure, so that only one instance is ever created ... > I've been using public statics since the move to c# and wondered if this ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Microsoft Data Access Block and static methods
    ... environment and couldn't let static methods not be thread safe. ... Since locks add some performance overhead (and a lot of ... classes instead of using statics, or that it's ok to use statics in ... I perform a SQL query only, not storing the result of that query to a ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: private static
    ... For some reason I thought this wouldn't compile because the statics weren't ... >> not require an instantiation of the host class, but being private, ... > You can call private static methods from other static methods ...
    (microsoft.public.dotnet.framework.aspnet)