Re: Get Class object for array




"Andreas Wollschlaeger" <postmaster@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:f1dceg$55n$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Mike Schilling wrote:
For a call to Class.getMethod(), I need the Class instance that
represents Class[]. Obviously, I can do

(new Class[0]).getClass()

but is there anything neater?

To my surprise,

Class[].class

works.... gee, and i thought i *know* Java ;-)

So it does :-)

I tried (Class[]).class which doesn't.

Thanks.


.