Adam P. Jenkins wrote:

> Object polymorph(Object snufkin) {
>   Method m = snufkin.getClass().getMethod("foo", null);
>   return m.invoke(snufkin, null);
> }
>
> You'll need to add a throws clause to the above method, but otherwise 
> that's all there is to it in Java.

That calls the instance method on the object. We're talking about 
calling a class (static) method on the class. See ruby-talk:148794 
again. As far as I know (and I could be wrong), you could pull it off 
only if you require the client to pass in a String of the qualified 
name, or the corresponding Class object.

BTW, I'm not *completely* anti-Java. I do, after all, like the 
package/import thing it's got going, even if it does require decent IDE 
support not to be painful.

Also, it's pretty decent compared to other popular languages, and it's 
got a fantastic developer community (see Jakarta, Codehaus, 
OpenSymphony, etc.).

Devin