/* * Example.java - Demonstrate the simple class loader. * * Copyright (c) 1996 Chuck McManis, All Rights Reserved. * * Permission to use, copy, modify, and distribute this software * and its documentation for NON-COMMERCIAL purposes and without * fee is hereby granted provided that this copyright notice * appears in all copies. * * CHUCK MCMANIS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. CHUCK MCMANIS * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ public class Example { public static void main(String args[]) { SimpleClassLoader sc = new SimpleClassLoader(); Object o; String tst = "TestClass"; System.out.println("This program will exercise the SimpleClassLoader."); if (args.length != 0) tst = args[0]; try { o = (sc.loadClass(tst)).newInstance(); ((LocalModule) o).start("none"); } catch (Exception e) { System.out.println("Caught exception : "+e); } } }