in the documentation, Class.toString() takes no parameters, so how is it
accepting the interger?
-----Original Message-----
From: Jeff Emanuel [mailto:JEmanuel@...
Sent: Wednesday, September 29, 2004 9:55 AM
To: Bryan Weingarten; jython-users@...
Subject: RE: [Jython-users] toString
=09
=09
=20
It's probably being resolved as java.lang.Class.toString.
java.lang.Class.toString(10) return '10'. MyClass is an
instance of Class.
-----Original Message-----
From: jython-users-admin@...
[mailto:jython-users-admin@...] On Behalf Of Bryan
Weingarten
Sent: Wednesday, September 29, 2004 9:25 AM
To: jython-users@...
Subject: [Jython-users] toString
=09
=09
i saw a faq on the internet about this issue, but i
still don't understand it, so i hope someone here can explain it to me.
i'm calling a class that has a static method=20
=20
class MyClass {
public String toString(int) {
}
}
=20
i'm unable to call this method from jython using the
direct normal method.
=20
s =3D mypackage.MyClass.toString(10)
=20
when i do call this method, it prints out the string
'10' instead of the string of returned my MyClass.toString. the faq i
read said something about jython prefering to call instance methods
which the Class object has. but the Class object doesn't have a
toString method that takes an int parameter, so i'm confused about this.
the int value was passed into some method, but which one? i know there
is a workaround to this by getting the toString attribute from MyCLass
explicitly then invoking the method, but i was curious what exactly is
going on here.
=20
thanks,
=20
bryan=20
=20
=20
=20
|