From: Updike, Clark <Clark.Updike@jh...> - 2003-05-19 14:51:36
You can't override a static method... only 'hide' or 'shadow' it.
That is fundamental to java (not a jython problem). =20
Search the article below for this string:=20
"A third example is that of hiding"
This may help you to do what you want:
Regarding synchronization, there's a snippet down in the discussion=20
section that demonstrates synchronizing a bit of code using=20
lock.acquire & lock.release:
From: Fr=E9d=E9ric Laurent [mailto:fl@...]
Sent: Monday, May 19, 2003 9:46 AM
Subject: [Jython-users] howto ? synchronized and static
I want to write a jython class that extends=20
But I have to override
public static Logger getLogger(String name,
How can I do in jython ?
def getLogger(self, name, resourceBundleName) is not static
Moreover if I want to write this kind of method
public static synchronized Logger getLogger(String name,
how can I tag my method as static and synchronized ?
thanks in advance
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful,
don't do it! Check out ObjectStore. Now part of Progress Software.
Jython-users mailing list
At 10:49 19.05.2003 -0400, Updike, Clark wrote:
>You can't override a static method... only 'hide' or 'shadow' it.
>That is fundamental to java (not a jython problem).
Indeed. It could make sense for jythonc (or its future equivalent) to add
the possibility to define static methods, but is really more a nice to have.
An interface in Java (the language construct) cannot involve static
methods, and this is true for an interface also in the loose sense (unless
reflection is used on the client side (rare)). That means that complying
with an interface does not ever require static methods (unless reflection
is used on the client side (rare)).
All access to static methods involve a statically declared class (up to
MyClass obj = ...;
No dynamic dispatch happens with static methods.