Apache Common Java

import org.apache.commons.collections.Factory;
import org.apache.commons.collections.FactoryUtils;
public class FactoryExampleV1 {
  public static void main(String args[]) {
    Factory bufferFactory = FactoryUtils.instantiateFactory(StringBuffer.class,
                          new Class[] {String.class},
                          new Object[] {"a string"});
    System.err.println(bufferFactory.create());
  }
}
           
       
ApacheCollectionFactoryExampleV1.zip( 513 k)