This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes dynamically loading a class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "dynamically loading a class" Watch "dynamically loading a class" New topic
Author

dynamically loading a class

ralph roper
Greenhorn

Joined: Nov 25, 2001
Posts: 25
Is there a way to pass constructor parameters when dynamically loading a class ? ie Class.forName()
The class I am trying to load is related to a database table. Does anyone know if using JDO is a better alternative to dynamically loading a class ? (.. or am I completely off the track here
?)
Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
Use the Class.getConstructor(Class[] parameterTypes) method and then get a new instance from that Constructor using Constructor.newInstance(Object[] initargs)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamically loading a class
 
Similar Threads
Hotdeploy Jar
Need for Class Loading using Class.forName
dynamic class loading
Class.forName() vs ClassLoader.loadClass()
Dynamic and Static class loading...