[Edu-sig] re: Does edu-sig extend to Jython

Kirby Urner urnerk@qwest.net
Mon, 19 Aug 2002 15:32:26 -0700


I think the usual thing with method overloading in Java is to
accommodate different numbers of arguments of various types,
e.g. (int int int) verus (int int) or (int int) versus (float
int) -- all with the same method name (the compiler tells
them apart by the type signature of the parameters, same as
in C++).

What I *don't* think any standard Java API is designed to
accommodate is simple parameter switching, i.e. to catch
(int a, int b) verus (int b, int a).  Nor even (int a, float b)
versus (float b, int a).

It *is* possible to code for these multiple variations and
permutations, but it's entirely customary to burden the class
user with the job of at least getting the *order* of the
parameters right.  The multiplicity of methods has to do
with differences that are *not* at the level of parameter
ordering alone.

Someone please correct me if I'm wrong about this.

Kirby