The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Calling non default constructors

Posted by J.Shiva Shankar on December 13, 2000 at 8:26 AM

Hi,

I am attempting to write a program whereby I need to have a factory which reads a mapping file of id versus classname. After retrieving the class name I need to call the non default constructor of the class. The ClassLoader.loadClass does not take any parameters. Apart from the idea of going via Reflection and querying all the constructors to get the exact match with the parameter types passed Is there any way I can do this?

Thanks and Regards
Shiva



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us