Something like Class.forName(''...").newInstance in Java?

hello all,
I'm looking for something like Class.forName(''...").newInstance in Java?,
I mean, where the className is passed in as a String,
do ruby have similiar construct like that?
Thank you very much.

Object.const_get("...").new

Farrel

···

On 17/08/06, femto femto <femtowin@gmail.com> wrote:

hello all,
I'm looking for something like Class.forName(''...").newInstance in Java?,
I mean, where the className is passed in as a String,
do ruby have similiar construct like that?
Thank you very much.

got it,Thanks.

···

On 8/17/06, Farrel Lifson <farrel.lifson@gmail.com> wrote:

On 17/08/06, femto femto <femtowin@gmail.com> wrote:
> hello all,
> I'm looking for something like Class.forName(''...").newInstance in Java?,
> I mean, where the className is passed in as a String,
> do ruby have similiar construct like that?
> Thank you very much.
>

Object.const_get("...").new

Farrel

--
Best Regards
femto http://femto.blogdriver.com

Facets' constant() method is sometimes easier.

  http://facets.rubyforge.org/api/core/classes/Kernel.html#M000437