struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject RE: [OT] Use of Static Methods
Date Wed, 09 Jul 2003 19:12:01 GMT
--- Brian Lee <brian_a_lee@hotmail.com> wrote:
> >From: David Graham <grahamdavid1980@yahoo.com>
> >Reply-To: dgraham@apache.org
> >To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> >
> > >
> > > 2) It is not correct to say that static methods can't be overriden.
> They
> > > can
> > > be overridden with another static method. You can't override a
> static
> > > method
> > > to be non-static, however.
> >
> >That's incorrect.  Static methods cannot be overridden.
> 
> Actually, that's incorrect. Static method can be overridden.
> 
> foo.java
> public class foo{
> public static void bar(){}
> }
> 
> baz.java
> public class baz extends foo{
> public static void bar(){}
> }
> 
> compiles

Of course that compiles.  You've hidden the definition from foo, *not*
overridden it.   There is a huge difference.

David

> 
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message