// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;

public class Test1 {
    public static void main(String[] args) {
        System.out.printf("Current dir has %d files\n", new File(".").list().length);
        Test o = null;
        try {
            URLClassLoader cl = new URLClassLoader(new URL[] { new URL("file:test1x.jar") });
            o = (Test)Class.forName("Test1X", true, cl).newInstance();
        } catch(Exception ex) {
            System.err.println(ex.getClass().getName() + " : " + ex.getMessage());
            System.exit(1);
        }
        o.test();
    }
}
